mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
Merge pull request #1959 from AlanCoding/cpf8
flake8 errors in access.py due to an upgrade
This commit is contained in:
commit
03d975e18d
@ -1622,7 +1622,7 @@ class JobLaunchConfigAccess(BaseAccess):
|
|||||||
if isinstance(sub_obj, Credential) and relationship == 'credentials':
|
if isinstance(sub_obj, Credential) and relationship == 'credentials':
|
||||||
return self.user in sub_obj.use_role
|
return self.user in sub_obj.use_role
|
||||||
else:
|
else:
|
||||||
raise NotImplemented('Only credentials can be attached to launch configurations.')
|
raise NotImplementedError('Only credentials can be attached to launch configurations.')
|
||||||
|
|
||||||
def can_unattach(self, obj, sub_obj, relationship, data, skip_sub_obj_read_check=False):
|
def can_unattach(self, obj, sub_obj, relationship, data, skip_sub_obj_read_check=False):
|
||||||
if isinstance(sub_obj, Credential) and relationship == 'credentials':
|
if isinstance(sub_obj, Credential) and relationship == 'credentials':
|
||||||
@ -1631,7 +1631,7 @@ class JobLaunchConfigAccess(BaseAccess):
|
|||||||
else:
|
else:
|
||||||
return self.user in sub_obj.read_role
|
return self.user in sub_obj.read_role
|
||||||
else:
|
else:
|
||||||
raise NotImplemented('Only credentials can be attached to launch configurations.')
|
raise NotImplementedError('Only credentials can be attached to launch configurations.')
|
||||||
|
|
||||||
|
|
||||||
class WorkflowJobTemplateNodeAccess(BaseAccess):
|
class WorkflowJobTemplateNodeAccess(BaseAccess):
|
||||||
@ -1720,7 +1720,7 @@ class WorkflowJobTemplateNodeAccess(BaseAccess):
|
|||||||
elif relationship in ('success_nodes', 'failure_nodes', 'always_nodes'):
|
elif relationship in ('success_nodes', 'failure_nodes', 'always_nodes'):
|
||||||
return self.check_same_WFJT(obj, sub_obj)
|
return self.check_same_WFJT(obj, sub_obj)
|
||||||
else:
|
else:
|
||||||
raise NotImplemented('Relationship {} not understood for WFJT nodes.'.format(relationship))
|
raise NotImplementedError('Relationship {} not understood for WFJT nodes.'.format(relationship))
|
||||||
|
|
||||||
def can_unattach(self, obj, sub_obj, relationship, data, skip_sub_obj_read_check=False):
|
def can_unattach(self, obj, sub_obj, relationship, data, skip_sub_obj_read_check=False):
|
||||||
if not self.wfjt_admin(obj):
|
if not self.wfjt_admin(obj):
|
||||||
@ -1735,7 +1735,7 @@ class WorkflowJobTemplateNodeAccess(BaseAccess):
|
|||||||
elif relationship in ('success_nodes', 'failure_nodes', 'always_nodes'):
|
elif relationship in ('success_nodes', 'failure_nodes', 'always_nodes'):
|
||||||
return self.check_same_WFJT(obj, sub_obj)
|
return self.check_same_WFJT(obj, sub_obj)
|
||||||
else:
|
else:
|
||||||
raise NotImplemented('Relationship {} not understood for WFJT nodes.'.format(relationship))
|
raise NotImplementedError('Relationship {} not understood for WFJT nodes.'.format(relationship))
|
||||||
|
|
||||||
|
|
||||||
class WorkflowJobNodeAccess(BaseAccess):
|
class WorkflowJobNodeAccess(BaseAccess):
|
||||||
|
Loading…
Reference in New Issue
Block a user