From 34b1ded2cbf6d91ba35bd47dfd15b51206c58c10 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 16 Sep 2019 21:01:37 -0700 Subject: [PATCH] [stable-2.7] Mark ansible-test cloud credentials as sensitive.. (cherry picked from commit 9f7b124a6fe616c3fd06d500c1a6f6969c57ba2d) Co-authored-by: Matt Clay . --- test/runner/lib/cloud/azure.py | 5 +++++ test/runner/lib/cloud/cs.py | 2 ++ test/runner/lib/cloud/tower.py | 2 ++ 3 files changed, 9 insertions(+) diff --git a/test/runner/lib/cloud/azure.py b/test/runner/lib/cloud/azure.py index 03297fc9d72..f643d522227 100644 --- a/test/runner/lib/cloud/azure.py +++ b/test/runner/lib/cloud/azure.py @@ -122,6 +122,8 @@ class AzureCloudProvider(CloudProvider): RESOURCE_GROUP_SECONDARY=response['resourceGroupNames'][1], ) + display.sensitive.add(values['AZURE_SECRET']) + config = '\n'.join('%s: %s' % (key, values[key]) for key in sorted(values)) self._write_config(config) @@ -142,6 +144,9 @@ class AzureCloudEnvironment(CloudEnvironment): """ config = get_config(self.config_path) + display.sensitive.add(config.get('AZURE_SECRET')) + display.sensitive.add(config.get('AZURE_PASSWORD')) + cmd.append('-e') cmd.append('resource_prefix=%s' % self.resource_prefix) cmd.append('-e') diff --git a/test/runner/lib/cloud/cs.py b/test/runner/lib/cloud/cs.py index 0b0e3fee950..e0429682b0b 100644 --- a/test/runner/lib/cloud/cs.py +++ b/test/runner/lib/cloud/cs.py @@ -199,6 +199,8 @@ class CsCloudProvider(CloudProvider): SECRET=credentials['secretkey'], ) + display.sensitive.add(values['SECRET']) + config = self._populate_config_template(config, values) self._write_config(config) diff --git a/test/runner/lib/cloud/tower.py b/test/runner/lib/cloud/tower.py index ded9ec1fe2e..bef03228dcb 100644 --- a/test/runner/lib/cloud/tower.py +++ b/test/runner/lib/cloud/tower.py @@ -117,6 +117,8 @@ class TowerCloudProvider(CloudProvider): PASSWORD=connection.password, ) + display.sensitive.add(values['PASSWORD']) + config = self._populate_config_template(config, values) self._write_config(config)