Skip to content

Commit

Permalink
fix case when state=null
Browse files Browse the repository at this point in the history
  • Loading branch information
russoz committed Feb 24, 2025
1 parent 6ac825e commit 87cbfbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/modules/apache2_mod_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class ApacheModProxy(ModuleHelper):
def __init_module__(self):
deps.validate(self.module)

if len(self.vars.state) > 1 and ("present" in self.vars.state or "enabled" in self.vars.state):
if len(self.vars.state or []) > 1 and ("present" in self.vars.state or "enabled" in self.vars.state):
self.do_raise(msg="states present/enabled are mutually exclusive with other states!")

self.mybalancer = Balancer(self.module, self.vars.balancer_vhost, self.vars.balancer_url_suffix, tls=self.vars.tls)
Expand All @@ -400,7 +400,7 @@ def __run__(self):
member_exists = False
member_status = {'disabled': False, 'drained': False, 'hot_standby': False, 'ignore_errors': False}
for mode in member_status:
for state in self.vars.state:
for state in self.vars.state or []:
if mode == state:
member_status[mode] = True
elif mode == 'disabled' and state == 'absent':
Expand Down

0 comments on commit 87cbfbd

Please sign in to comment.