本文整理汇总了Python中resource_management.core.environment.Environment.has_instance方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.has_instance方法的具体用法?Python Environment.has_instance怎么用?Python Environment.has_instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resource_management.core.environment.Environment
的用法示例。
在下文中一共展示了Environment.has_instance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: format
# 需要导入模块: from resource_management.core.environment import Environment [as 别名]
# 或者: from resource_management.core.environment.Environment import has_instance [as 别名]
def format(self, format_string, *args, **kwargs):
variables = kwargs
if Environment.has_instance():
env = Environment.get_instance()
params = env.config.params
# don't use checked_unite for this as it would interfere with reload(module)
# for things like params and status_params; instead, start out copying
# the environment parameters and add in any locally declared variables to
# override existing env parameters
all_params = params.copy()
else:
all_params = {}
all_params.update(variables)
self.convert_field = self.convert_field_protected
result_protected = self.vformat(format_string, args, all_params)
self.convert_field = self.convert_field_unprotected
result_unprotected = self.vformat(format_string, args, all_params)
if result_protected != result_unprotected:
Logger.sensitive_strings[result_unprotected] = result_protected
return result_unprotected