From d0ae8186851cab5f965f346c66255dcd97a47b84 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 20 Mar 2017 17:02:05 -0400 Subject: [PATCH 1/2] show extra variables (if any) in the adhoc command results UI see: #1744 --- .../adhoc/standard-out-adhoc.partial.html | 20 +++++++++++++++++++ .../standard-out/standard-out.controller.js | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html b/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html index c2baf24ee9..b8ef147b28 100644 --- a/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html +++ b/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html @@ -99,6 +99,26 @@
Verbosity
{{ verbosity }}
+ +
+
+ Extra Variables + + +
+
+ +
+
+ diff --git a/awx/ui/client/src/standard-out/standard-out.controller.js b/awx/ui/client/src/standard-out/standard-out.controller.js index 64f34cb68f..45a5676af1 100644 --- a/awx/ui/client/src/standard-out/standard-out.controller.js +++ b/awx/ui/client/src/standard-out/standard-out.controller.js @@ -149,7 +149,11 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, } if (data.extra_vars) { - ParseTypeChange({ scope: $scope, field_id: 'pre-formatted-variables' }); + ParseTypeChange({ + scope: $scope, + field_id: 'pre-formatted-variables', + readOnly: true + }); } if ($scope.job.type === 'inventory_update' && !$scope.inv_manage_group_link) { From ba0e9ab7756728164404f7eb4c3fc82b264b01a1 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 20 Mar 2017 17:20:33 -0400 Subject: [PATCH 2/2] copy extra_vars when relaunching ad-hoc commands see: #1744 --- awx/api/views.py | 2 +- awx/main/models/ad_hoc_commands.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/api/views.py b/awx/api/views.py index 3c5d5b9dc9..33ef14826a 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -3666,7 +3666,7 @@ class AdHocCommandRelaunch(GenericAPIView): data = {} for field in ('job_type', 'inventory_id', 'limit', 'credential_id', 'module_name', 'module_args', 'forks', 'verbosity', - 'become_enabled'): + 'extra_vars', 'become_enabled'): if field.endswith('_id'): data[field[:-3]] = getattr(obj, field) else: diff --git a/awx/main/models/ad_hoc_commands.py b/awx/main/models/ad_hoc_commands.py index 3636aa8e0a..d6c97e6f86 100644 --- a/awx/main/models/ad_hoc_commands.py +++ b/awx/main/models/ad_hoc_commands.py @@ -190,7 +190,7 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin): data = {} for field in ('job_type', 'inventory_id', 'limit', 'credential_id', 'module_name', 'module_args', 'forks', 'verbosity', - 'become_enabled'): + 'extra_vars', 'become_enabled'): data[field] = getattr(self, field) return AdHocCommand.objects.create(**data)