Fix: prefixed namespace bug and log messages
This commit is contained in:
parent
3bf4bc8da3
commit
82b44ad8ad
@ -264,7 +264,7 @@ class AnsibleKheops:
|
|||||||
|
|
||||||
conf_data = None
|
conf_data = None
|
||||||
if isinstance(config, str):
|
if isinstance(config, str):
|
||||||
self.display.vv("Read Kheops file config", config)
|
self.display.vv("Read Kheops file config %s" % config)
|
||||||
if os.path.isfile(config):
|
if os.path.isfile(config):
|
||||||
data = open(config, "r", encoding="utf-8")
|
data = open(config, "r", encoding="utf-8")
|
||||||
conf_data = yaml.safe_load(data)
|
conf_data = yaml.safe_load(data)
|
||||||
@ -272,7 +272,7 @@ class AnsibleKheops:
|
|||||||
raise AnsibleError(f"Unable to find configuration file {config}")
|
raise AnsibleError(f"Unable to find configuration file {config}")
|
||||||
|
|
||||||
elif isinstance(config, dict):
|
elif isinstance(config, dict):
|
||||||
self.display.vv("Read Kheops direct config", config)
|
self.display.vv("Read Kheops direct config %s" % config)
|
||||||
conf_data = config
|
conf_data = config
|
||||||
elif isinstance(config, type(None)):
|
elif isinstance(config, type(None)):
|
||||||
continue
|
continue
|
||||||
@ -400,7 +400,7 @@ class AnsibleKheops:
|
|||||||
self.display.vvv(f"Transformed scope value: {value} => {res}")
|
self.display.vvv(f"Transformed scope value: {value} => {res}")
|
||||||
except AnsibleUndefinedVariable as err:
|
except AnsibleUndefinedVariable as err:
|
||||||
self.display.error(f"Got templating error for string '{value}': {err}")
|
self.display.error(f"Got templating error for string '{value}': {err}")
|
||||||
raise Exception() from err
|
raise err
|
||||||
|
|
||||||
ret[key] = res
|
ret[key] = res
|
||||||
|
|
||||||
@ -423,15 +423,13 @@ class AnsibleKheops:
|
|||||||
self.display.v(f"Kheops keys: {keys}")
|
self.display.v(f"Kheops keys: {keys}")
|
||||||
self.display.vv(f"Kheops scope: {scope}")
|
self.display.vv(f"Kheops scope: {scope}")
|
||||||
|
|
||||||
# try:
|
|
||||||
ret = self.kheops.lookup(
|
ret = self.kheops.lookup(
|
||||||
keys=keys,
|
keys=keys,
|
||||||
scope=scope,
|
scope=scope,
|
||||||
# trace=True,
|
# trace=True,
|
||||||
explain=explain,
|
explain=explain,
|
||||||
|
namespace_prefix=False
|
||||||
)
|
)
|
||||||
# except Exception as err:
|
|
||||||
# raise AnsibleError(err)
|
|
||||||
|
|
||||||
# Remap output
|
# Remap output
|
||||||
for key in keys_config:
|
for key in keys_config:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user