Skip to content

Commit

Permalink
fix dict variable handling for existence check (#175)
Browse files Browse the repository at this point in the history
Signed-off-by: hirokuni-kitahara <[email protected]>
  • Loading branch information
hirokuni-kitahara authored Aug 29, 2023
1 parent eb287fd commit 3f17749
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ansible_risk_insight/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ def resolve_single_variable(self, txt, resolve_history=[]):
def update_flat_vars(self, new_vars: dict, _prefix: str = ""):
for k, v in new_vars.items():
if isinstance(v, dict):
new_prefix = f"{k}." if _prefix == "" else f"{_prefix}{k}"
flat_var_name = f"{_prefix}{k}"
self._flat_vars.update({flat_var_name: v})
new_prefix = f"{flat_var_name}."
self.update_flat_vars(v, new_prefix)
else:
flat_key = f"{_prefix}{k}"
Expand Down

0 comments on commit 3f17749

Please sign in to comment.