Azure RM Common - use built in module logging (#43820)
parent
5f36c73fe5
commit
90517f4dfa
|
@ -9,6 +9,7 @@ import types
|
|||
import copy
|
||||
import inspect
|
||||
import traceback
|
||||
import json
|
||||
|
||||
from os.path import expanduser
|
||||
|
||||
|
@ -36,7 +37,6 @@ AZURE_COMMON_ARGS = dict(
|
|||
cert_validation_mode=dict(type='str', choices=['validate', 'ignore']),
|
||||
api_profile=dict(type='str', default='latest'),
|
||||
adfs_authority_url=dict(type='str', default=None)
|
||||
# debug=dict(type='bool', default=False),
|
||||
)
|
||||
|
||||
AZURE_CREDENTIAL_ENV_MAPPING = dict(
|
||||
|
@ -282,7 +282,6 @@ class AzureRMModuleBase(object):
|
|||
self.check_mode = self.module.check_mode
|
||||
self.api_profile = self.module.params.get('api_profile')
|
||||
self.facts_module = facts_module
|
||||
# self.debug = self.module.params.get('debug')
|
||||
|
||||
# authenticate
|
||||
self.credentials = self._get_credentials(self.module.params)
|
||||
|
@ -435,14 +434,10 @@ class AzureRMModuleBase(object):
|
|||
self.module.deprecate(msg, version)
|
||||
|
||||
def log(self, msg, pretty_print=False):
|
||||
pass
|
||||
# Use only during module development
|
||||
# if self.debug:
|
||||
# log_file = open('azure_rm.log', 'a')
|
||||
# if pretty_print:
|
||||
# log_file.write(json.dumps(msg, indent=4, sort_keys=True))
|
||||
# else:
|
||||
# log_file.write(msg + u'\n')
|
||||
if pretty_print:
|
||||
self.module.debug(json.dumps(msg, indent=4, sort_keys=True))
|
||||
else:
|
||||
self.module.debug(msg)
|
||||
|
||||
def validate_tags(self, tags):
|
||||
'''
|
||||
|
@ -996,7 +991,6 @@ class AzureRMModuleBase(object):
|
|||
|
||||
@property
|
||||
def storage_models(self):
|
||||
self.log('Getting storage models...')
|
||||
return StorageManagementClient.models("2017-10-01")
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue