diff --git a/plugins/modules/azure_rm_keyvaultkey.py b/plugins/modules/azure_rm_keyvaultkey.py index 985775b9a..33cb80070 100644 --- a/plugins/modules/azure_rm_keyvaultkey.py +++ b/plugins/modules/azure_rm_keyvaultkey.py @@ -224,8 +224,8 @@ def get_keyvault_client(self): self.log("Get KeyVaultClient from service principal") elif (self.module.params['auth_source'] == 'cli' or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): + and self.credentials.get('client_id') is None + and self.credentials.get('secret') is None)): try: profile = get_cli_profile() credentials, subscription_id, tenant = profile.get_login_credentials( diff --git a/plugins/modules/azure_rm_keyvaultkey_info.py b/plugins/modules/azure_rm_keyvaultkey_info.py index 7247ec4eb..26cb67afd 100644 --- a/plugins/modules/azure_rm_keyvaultkey_info.py +++ b/plugins/modules/azure_rm_keyvaultkey_info.py @@ -323,8 +323,8 @@ def get_keyvault_client(self): self.log("Get KeyVaultClient from service principal") elif (self.module.params['auth_source'] == 'cli' or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): + and self.credentials.get('client_id') is None + and self.credentials.get('secret') is None)): try: profile = get_cli_profile() credentials, subscription_id, tenant = profile.get_login_credentials( diff --git a/plugins/modules/azure_rm_keyvaultsecret.py b/plugins/modules/azure_rm_keyvaultsecret.py index 0a5288abb..f107166b5 100644 --- a/plugins/modules/azure_rm_keyvaultsecret.py +++ b/plugins/modules/azure_rm_keyvaultsecret.py @@ -209,8 +209,8 @@ def get_keyvault_client(self): self.log("Get KeyVaultClient from service principal") elif (self.module.params['auth_source'] == 'cli' or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): + and self.credentials.get('client_id') is None + and self.credentials.get('secret') is None)): try: profile = get_cli_profile() credentials, subscription_id, tenant = profile.get_login_credentials( diff --git a/plugins/modules/azure_rm_keyvaultsecret_info.py b/plugins/modules/azure_rm_keyvaultsecret_info.py index a785b8ce7..cb181ca98 100644 --- a/plugins/modules/azure_rm_keyvaultsecret_info.py +++ b/plugins/modules/azure_rm_keyvaultsecret_info.py @@ -277,8 +277,8 @@ def get_keyvault_client(self): self.log("Get KeyVaultClient from service principal") elif (self.module.params['auth_source'] == 'cli' or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): + and self.credentials.get('client_id') is None + and self.credentials.get('secret') is None)): try: profile = get_cli_profile() credentials, subscription_id, tenant = profile.get_login_credentials(