Skip to content

Commit

Permalink
deubg
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Apr 10, 2021
1 parent e69fbae commit 7bd6933
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions st2common/st2common/util/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def _assign_dynamic_config_values(self, schema, config, parent_keys=None):
:rtype: ``dict``
"""
LOG.info("_assign_dynamic parent_keys: %s", parent_keys)
parent_keys = parent_keys or []

config_is_dict = isinstance(config, dict)
Expand All @@ -134,6 +135,7 @@ def _assign_dynamic_config_values(self, schema, config, parent_keys=None):
# if config_is_list then this is the index of them item
# config_item_value - the value of the key/index for the current item
for config_item_key, config_item_value in iterator:
LOG.info("_assign_dynamic config_item_key: %s", config_item_key)
if config_is_dict:
# different schema for each key/value pair
schema_item = schema.get(config_item_key, {})
Expand All @@ -151,6 +153,7 @@ def _assign_dynamic_config_values(self, schema, config, parent_keys=None):
schema_item,
additional_properties_keys=config_item_value.keys(),
)
LOG.info("_assign_dynamic property_schema: %s", property_schema)
self._assign_dynamic_config_values(
schema=property_schema,
config=config[config_item_key],
Expand All @@ -168,6 +171,7 @@ def _assign_dynamic_config_values(self, schema, config, parent_keys=None):
is_jinja_expression = jinja_utils.is_jinja_expression(
value=config_item_value
)
LOG.info("_assign_dynamic is_jinja_expression: %s", is_jinja_expression)

if is_jinja_expression:
# Resolve / render the Jinja template expression
Expand Down Expand Up @@ -233,6 +237,7 @@ def _get_datastore_value_for_expression(self, key, value, config_schema_item=Non
:param key: Full path to the config item key (e.g. "token" / "auth.settings.token", etc.)
"""
from st2common.services.config import deserialize_key_value
LOG.info("_get_datastore_value value 1: %s", value)

config_schema_item = config_schema_item or {}
secret = config_schema_item.get("secret", False)
Expand All @@ -252,6 +257,7 @@ def _get_datastore_value_for_expression(self, key, value, config_schema_item=Non
)
raise RuntimeError(msg)

LOG.info("_get_datastore_value value 2: %s", value)
if value:
# Deserialize the value
value = deserialize_key_value(value=value, secret=secret)
Expand Down

0 comments on commit 7bd6933

Please sign in to comment.