From f1aa58544166a5b527d0b76ef2b42ad4916af9fe Mon Sep 17 00:00:00 2001 From: Gevorg-Khachatryaan Date: Mon, 21 Feb 2022 11:04:47 +0400 Subject: [PATCH 1/2] clean up pbrs.py --- plugins/module_utils/prism/pbrs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/module_utils/prism/pbrs.py b/plugins/module_utils/prism/pbrs.py index 3ee7d3603..4fa610371 100644 --- a/plugins/module_utils/prism/pbrs.py +++ b/plugins/module_utils/prism/pbrs.py @@ -16,7 +16,6 @@ def __init__(self, module): super(Pbr, self).__init__(module, resource_type=resource_type) self.build_spec_methods = { "priority": self._build_spec_priority, - # "pbr_uuid": self.build_spec_pbr_uuid, "vpc": self._build_spec_vpc, "source": self._build_spec_source, "destination": self._build_spec_destination, From 3080b817132bba0feb9a175feda008187d247768 Mon Sep 17 00:00:00 2001 From: Gevorg-Khachatryaan Date: Mon, 21 Feb 2022 14:01:16 +0400 Subject: [PATCH 2/2] #114 add ability to use "any" for ICMP option --- plugins/modules/ntnx_pbrs.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/modules/ntnx_pbrs.py b/plugins/modules/ntnx_pbrs.py index d84c9417e..3fa93792d 100644 --- a/plugins/modules/ntnx_pbrs.py +++ b/plugins/modules/ntnx_pbrs.py @@ -428,14 +428,21 @@ def get_module_spec(): dst=dict(type="list", default=["*"], elements="str"), ) - icmp_spec = dict(code=dict(type="int"), type=dict(type="int")) + icmp_spec = dict( + any=dict(type="bool"), code=dict(type="int"), type=dict(type="int") + ) protocol_spec = dict( any=dict(type="bool"), tcp=dict(type="dict", options=tcp_and_udp_spec), udp=dict(type="dict", options=tcp_and_udp_spec), number=dict(type="int"), - icmp=dict(type="dict", options=icmp_spec), + icmp=dict( + type="dict", + options=icmp_spec, + mutually_exclusive=[("any", "code"), ("any", "type")], + required_by={"type": "code"}, + ), ) action_spec = dict(