Skip to content

Commit

Permalink
fix build black code
Browse files Browse the repository at this point in the history
  • Loading branch information
afourmy committed Aug 3, 2020
1 parent 06b0e2a commit b0a3ca2
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions eNMS/models/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,19 +1111,21 @@ def global_variables(_self, **locals): # noqa: N805
variables.update(payload.get("variables", {}))
if device and "devices" in payload.get("variables", {}):
variables.update(payload["variables"]["devices"].get(device.name, {}))
variables.update({
"__builtins__": {**builtins, "__import__": _self._import},
"send_email": app.send_email,
"settings": app.settings,
"devices": _self.devices,
"get_var": partial(_self.get_var, payload),
"get_result": _self.get_result,
"log": _self.log,
"workflow": _self.workflow,
"set_var": partial(_self.payload_helper, payload),
"parent_device": _self.parent_device or device,
"placeholder": _self.original.placeholder,
})
variables.update(
{
"__builtins__": {**builtins, "__import__": _self._import},
"send_email": app.send_email,
"settings": app.settings,
"devices": _self.devices,
"get_var": partial(_self.get_var, payload),
"get_result": _self.get_result,
"log": _self.log,
"workflow": _self.workflow,
"set_var": partial(_self.payload_helper, payload),
"parent_device": _self.parent_device or device,
"placeholder": _self.original.placeholder,
}
)
return variables

def eval(_self, query, function="eval", **locals): # noqa: N805
Expand Down

0 comments on commit b0a3ca2

Please sign in to comment.