From 207fff7d360a63c56ad91cb75ede37d2e3b7349d Mon Sep 17 00:00:00 2001 From: Yuwei Zhou Date: Sat, 18 May 2019 11:17:06 +0800 Subject: [PATCH] Fix the get property (#55745) (#55788) * Fix the get property (#55745) (cherry picked from commit c7bf3e035b3cc3304b0dcafc3437ba8ea0db30b4) --- changelogs/fragments/55745-azure_rm_common.yaml | 2 ++ lib/ansible/module_utils/azure_rm_common.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/55745-azure_rm_common.yaml diff --git a/changelogs/fragments/55745-azure_rm_common.yaml b/changelogs/fragments/55745-azure_rm_common.yaml new file mode 100644 index 00000000000..fe94de38266 --- /dev/null +++ b/changelogs/fragments/55745-azure_rm_common.yaml @@ -0,0 +1,2 @@ +bugfixes: + - Fix cannot get credential when `source_auth` set to `credential_file`. diff --git a/lib/ansible/module_utils/azure_rm_common.py b/lib/ansible/module_utils/azure_rm_common.py index 0115e31c699..530c0f1b864 100644 --- a/lib/ansible/module_utils/azure_rm_common.py +++ b/lib/ansible/module_utils/azure_rm_common.py @@ -1226,7 +1226,7 @@ class AzureRMAuth(object): if auth_source == 'credential_file': self.log("Retrieving credentials from credential file") - profile = params.get('profile', 'default') + profile = params.get('profile') or 'default' default_credentials = self._get_profile(profile) return default_credentials