mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 05:31:22 -03:30
Merge pull request #5403 from AlanCoding/duplicate_except
Fix duplicate exception sanity error (and a few others) Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
211786976d
@ -404,7 +404,7 @@ def main():
|
||||
result = credential.delete(**params)
|
||||
except (exc.NotFound) as excinfo:
|
||||
module.fail_json(msg='Failed to update credential, organization not found: {0}'.format(excinfo), changed=False)
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.NotFound, exc.AuthError) as excinfo:
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.AuthError) as excinfo:
|
||||
module.fail_json(msg='Failed to update credential: {0}'.format(excinfo), changed=False)
|
||||
|
||||
json_output['changed'] = result['changed']
|
||||
|
||||
@ -179,7 +179,7 @@ def main():
|
||||
result = group.delete(**params)
|
||||
except (exc.NotFound) as excinfo:
|
||||
module.fail_json(msg='Failed to update the group, inventory not found: {0}'.format(excinfo), changed=False)
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.NotFound, exc.AuthError) as excinfo:
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.AuthError) as excinfo:
|
||||
module.fail_json(msg='Failed to update the group: {0}'.format(excinfo), changed=False)
|
||||
|
||||
json_output['changed'] = result['changed']
|
||||
|
||||
@ -94,7 +94,7 @@ def main():
|
||||
result = label.delete(name=name, organization=org['id'])
|
||||
except (exc.NotFound) as excinfo:
|
||||
module.fail_json(msg='Failed to update label, organization not found: {0}'.format(excinfo), changed=False)
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.NotFound, exc.AuthError) as excinfo:
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.AuthError) as excinfo:
|
||||
module.fail_json(msg='Failed to update label: {0}'.format(excinfo), changed=False)
|
||||
|
||||
json_output['changed'] = result['changed']
|
||||
|
||||
@ -103,7 +103,7 @@ def main():
|
||||
result = team.delete(name=name, organization=org['id'])
|
||||
except (exc.NotFound) as excinfo:
|
||||
module.fail_json(msg='Failed to update team, organization not found: {0}'.format(excinfo), changed=False)
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.NotFound, exc.AuthError) as excinfo:
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.AuthError) as excinfo:
|
||||
module.fail_json(msg='Failed to update team: {0}'.format(excinfo), changed=False)
|
||||
|
||||
json_output['changed'] = result['changed']
|
||||
|
||||
@ -71,10 +71,11 @@ def run_module(request):
|
||||
resp.status_code = django_response.status_code
|
||||
|
||||
if request.config.getoption('verbose') > 0:
|
||||
logger.info('{} {} by {}, code:{}'.format(
|
||||
logger.info(
|
||||
'%s %s by %s, code:%s',
|
||||
method, '/api/' + url.split('/api/')[1],
|
||||
request_user.username, resp.status_code
|
||||
))
|
||||
)
|
||||
|
||||
return resp
|
||||
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import pytest
|
||||
|
||||
from awx.main.models import Organization, Inventory, Group
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import pytest
|
||||
|
||||
from awx.main.models import Organization, Inventory, InventorySource, Project
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user