Fix firewalld source option handling to be exclusive (#55715)

- Fix issue #55683
- Add integration test for source option of firewalld module

Signed-off-by: Hideki Saito <saito@fgrep.org>
This commit is contained in:
Hideki Saito 2019-05-02 06:47:47 +09:00 committed by ansibot
parent c707dd7b62
commit c455635500
4 changed files with 93 additions and 1 deletions

View file

@ -706,10 +706,12 @@ def main():
modification_count += 1
if masquerade is not None:
modification_count += 1
if source is not None:
modification_count += 1
if modification_count > 1:
module.fail_json(
msg='can only operate on port, service, rich_rule, masquerade, icmp_block, icmp_block_inversion, or interface at once'
msg='can only operate on port, service, rich_rule, masquerade, icmp_block, icmp_block_inversion, interface or source at once'
)
elif modification_count > 0 and desired_state in ['absent', 'present']:
module.fail_json(