mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Azure RM Common - use built in module logging (#43820)
This commit is contained in:
parent
5f36c73fe5
commit
90517f4dfa
1 changed files with 5 additions and 11 deletions
|
@ -9,6 +9,7 @@ import types
|
||||||
import copy
|
import copy
|
||||||
import inspect
|
import inspect
|
||||||
import traceback
|
import traceback
|
||||||
|
import json
|
||||||
|
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
|
|
||||||
|
@ -36,7 +37,6 @@ AZURE_COMMON_ARGS = dict(
|
||||||
cert_validation_mode=dict(type='str', choices=['validate', 'ignore']),
|
cert_validation_mode=dict(type='str', choices=['validate', 'ignore']),
|
||||||
api_profile=dict(type='str', default='latest'),
|
api_profile=dict(type='str', default='latest'),
|
||||||
adfs_authority_url=dict(type='str', default=None)
|
adfs_authority_url=dict(type='str', default=None)
|
||||||
# debug=dict(type='bool', default=False),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
AZURE_CREDENTIAL_ENV_MAPPING = dict(
|
AZURE_CREDENTIAL_ENV_MAPPING = dict(
|
||||||
|
@ -282,7 +282,6 @@ class AzureRMModuleBase(object):
|
||||||
self.check_mode = self.module.check_mode
|
self.check_mode = self.module.check_mode
|
||||||
self.api_profile = self.module.params.get('api_profile')
|
self.api_profile = self.module.params.get('api_profile')
|
||||||
self.facts_module = facts_module
|
self.facts_module = facts_module
|
||||||
# self.debug = self.module.params.get('debug')
|
|
||||||
|
|
||||||
# authenticate
|
# authenticate
|
||||||
self.credentials = self._get_credentials(self.module.params)
|
self.credentials = self._get_credentials(self.module.params)
|
||||||
|
@ -435,14 +434,10 @@ class AzureRMModuleBase(object):
|
||||||
self.module.deprecate(msg, version)
|
self.module.deprecate(msg, version)
|
||||||
|
|
||||||
def log(self, msg, pretty_print=False):
|
def log(self, msg, pretty_print=False):
|
||||||
pass
|
if pretty_print:
|
||||||
# Use only during module development
|
self.module.debug(json.dumps(msg, indent=4, sort_keys=True))
|
||||||
# if self.debug:
|
else:
|
||||||
# log_file = open('azure_rm.log', 'a')
|
self.module.debug(msg)
|
||||||
# if pretty_print:
|
|
||||||
# log_file.write(json.dumps(msg, indent=4, sort_keys=True))
|
|
||||||
# else:
|
|
||||||
# log_file.write(msg + u'\n')
|
|
||||||
|
|
||||||
def validate_tags(self, tags):
|
def validate_tags(self, tags):
|
||||||
'''
|
'''
|
||||||
|
@ -996,7 +991,6 @@ class AzureRMModuleBase(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def storage_models(self):
|
def storage_models(self):
|
||||||
self.log('Getting storage models...')
|
|
||||||
return StorageManagementClient.models("2017-10-01")
|
return StorageManagementClient.models("2017-10-01")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue