Skip to content

Commit

Permalink
fix(dokku_network_property): check for app key (#127)
Browse files Browse the repository at this point in the history
It appears that the `app` key is set in the `data` dictionary even if a value is not provided by the user.
The logic in the module assumed that the presence of the `app` key indicated that a value was provided by the user and therefore always raised an error when the `global` keyword was set to `True`.
This is fixed by checking instead whether the value for `app` is empty.
  • Loading branch information
fr3fou authored Nov 11, 2021
1 parent fe5b4a7 commit f5c8d1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/dokku_network_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def dokku_network_property_set(data):
has_changed = False
meta = {"present": False}

if data["global"] and "app" in data:
if data["global"] and data["app"]:
is_error = True
meta["error"] = 'When "global" is set to true, "app" must not be provided.'
return (is_error, has_changed, meta)
Expand Down

0 comments on commit f5c8d1a

Please sign in to comment.