From fdddba18be16a6bacc4ce4a28d1c8d324949ae49 Mon Sep 17 00:00:00 2001 From: beeankha Date: Fri, 11 Oct 2019 10:05:03 -0400 Subject: [PATCH] Update code to be compatible with py2 --- awxkit/awxkit/cli/custom.py | 51 ++++++++++++++----------------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/awxkit/awxkit/cli/custom.py b/awxkit/awxkit/cli/custom.py index 903f2e4fc7..f9077acab5 100644 --- a/awxkit/awxkit/cli/custom.py +++ b/awxkit/awxkit/cli/custom.py @@ -300,27 +300,21 @@ JobTemplateNotificationDisAssociation.targets.update({ class WorkflowJobTemplateNotificationAssociation(NotificationAssociateMixin, CustomAction): resource = 'workflow_job_templates' action = 'associate' - targets = dict( - **NotificationAssociateMixin.targets, - **{'approval_notification': [ - 'notification_templates_approvals', - 'notification_template' - ] - }, - ) + targets = NotificationAssociateMixin.targets.copy() class WorkflowJobTemplateNotificationDisAssociation(NotificationAssociateMixin, CustomAction): resource = 'workflow_job_templates' action = 'disassociate' - targets = dict( - **NotificationAssociateMixin.targets, - **{'approval_notification': [ - 'notification_templates_approvals', - 'notification_template' - ] - }, - ) + targets = NotificationAssociateMixin.targets.copy() + + +WorkflowJobTemplateNotificationAssociation.targets.update({ + 'approval_notification': ['notification_templates_approvals', 'notification_template'], +}) +WorkflowJobTemplateNotificationDisAssociation.targets.update({ + 'approval_notification': ['notification_templates_approvals', 'notification_template'], +}) class ProjectNotificationAssociation(NotificationAssociateMixin, CustomAction): @@ -346,29 +340,22 @@ class InventorySourceNotificationDisAssociation(NotificationAssociateMixin, Cust class OrganizationNotificationAssociation(NotificationAssociateMixin, CustomAction): resource = 'organizations' action = 'associate' - targets = dict( - **NotificationAssociateMixin.targets, - **{'approval_notification': [ - 'notification_templates_approvals', - 'notification_template' - ] - }, - ) + targets = NotificationAssociateMixin.targets.copy() class OrganizationNotificationDisAssociation(NotificationAssociateMixin, CustomAction): resource = 'organizations' action = 'disassociate' - targets = dict( - **NotificationAssociateMixin.targets, - **{'approval_notification': [ - 'notification_templates_approvals', - 'notification_template' - ] - }, - ) + targets = NotificationAssociateMixin.targets.copy() +OrganizationNotificationAssociation.targets.update({ + 'approval_notification': ['notification_templates_approvals', 'notification_template'], +}) +OrganizationNotificationDisAssociation.targets.update({ + 'approval_notification': ['notification_templates_approvals', 'notification_template'], +}) + class SettingsList(CustomAction): action = 'list' resource = 'settings'