Skip to content

Commit

Permalink
fix: firewall port argument is required with udp or tcp (#345)
Browse files Browse the repository at this point in the history
##### SUMMARY

When managing a tcp/udp firewall rule, provide a clear error message
when the port is missing from the rule.

Closes #344

##### ISSUE TYPE

- Bugfix Pull Request


##### COMPONENT NAME

hcloud_firewall
  • Loading branch information
jooola authored Oct 4, 2023
1 parent dc65831 commit 76c1abf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- hcloud_firewall - The port argument is required when the firewall rule protocol is `udp` or `tcp`.
4 changes: 4 additions & 0 deletions plugins/modules/hcloud_firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ def define_module(cls):
description={"type": "str"},
),
required_together=[["direction", "protocol"]],
required_if=[
["protocol", "udp", ["port"]],
["protocol", "tcp", ["port"]],
],
),
labels={"type": "dict"},
state={
Expand Down

0 comments on commit 76c1abf

Please sign in to comment.