Error checking and reporting on interface ufw rule
This commit is contained in:
parent
4cbe4b9306
commit
da107d3f0c
1 changed files with 3 additions and 0 deletions
|
@ -205,6 +205,9 @@ def main():
|
||||||
if len(commands) < 1:
|
if len(commands) < 1:
|
||||||
module.fail_json(msg="Not any of the command arguments %s given" % commands)
|
module.fail_json(msg="Not any of the command arguments %s given" % commands)
|
||||||
|
|
||||||
|
if('interface' in params and 'direction' not in params):
|
||||||
|
module.fail_json(msg="Direction must be specified when creating a rule on an interface")
|
||||||
|
|
||||||
# Ensure ufw is available
|
# Ensure ufw is available
|
||||||
ufw_bin = module.get_bin_path('ufw', True)
|
ufw_bin = module.get_bin_path('ufw', True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue