Skip to content

Commit

Permalink
Added additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dolejska-daniel committed Apr 11, 2021
1 parent 3a9a846 commit 430e467
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deployer/utils/schemas/event_binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ def conditions_and(conditions: dict[str, Any]):
if field_value != condition_value \
and (not isinstance(condition_value, str)
or re.match(condition_value, field_value) is None):
log.debug("field %s=%s failed to match %s", condition_field, field_value, condition_value)
return False

log.debug("field %s=%s matched %s", condition_field, field_value, condition_value)

except Exception:
log.exception("exception occured while trying to match %s with %s, field %s",
condition_value, locals().get("field_value", None), condition_field)
Expand All @@ -75,10 +78,13 @@ def conditions_and(conditions: dict[str, Any]):

for subconditions in self.conditions:
if conditions_and(subconditions):
log.debug("all subconditions matched!")
return True

return False

async def run(self, variables: dict[str, Any]):
for action in self.actions:
await action.run(variables)
log.debug("running action %s, variables=%s", action, variables)
action_result = await action.run(variables)
log.debug("action %s finished, result=%s", action, action_result)
1 change: 1 addition & 0 deletions plugin/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ async def command(cmd: str):
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE
)
log.debug(proc)
stdout, stderr = await proc.communicate()

log.debug(stdout.decode().strip())
Expand Down

0 comments on commit 430e467

Please sign in to comment.