Skip to content

Commit 93ff0df

Browse files
replacing dot with underscore
Signed-off-by: Shiva Shankar Vaddepally <[email protected]>
1 parent a7483f7 commit 93ff0df

File tree

5 files changed

+81
-83
lines changed

5 files changed

+81
-83
lines changed

examples/bgprouter.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
delegate_to: localhost
88
netscaler.adc.bgprouter:
99
state: present
10-
localAS: 122
11-
afParams.addressFamily: "ipv4"
12-
afParams.redistribute.protocol: "kernel"
10+
localAS: 10
11+
afParams_addressFamily: "ipv4"
12+
afParams_redistribute_protocol: "kernel"
1313
routerId: "10.102.201.219"
14-
neighbor.ASOriginationInterval: 15
15-
neighbor.address: "2.2.12.30"
16-
neighbor.advertisementInterval: 30
17-
neighbor.afParams.addressFamily: "ipv4"
18-
neighbor.holdTimerConfig: 90
19-
neighbor.keepaliveTimerConfig: 30
20-
neighbor.multihopBfd: "False"
21-
neighbor.remoteAS: 100
22-
neighbor.singlehopBfd: "False"
14+
neighbor_ASOriginationInterval: 15
15+
neighbor_address: "2.2.12.30"
16+
neighbor_advertisementInterval: 30
17+
neighbor_afParams_addressFamily: "ipv4"
18+
neighbor_holdTimerConfig: 90
19+
neighbor_keepaliveTimerConfig: 30
20+
neighbor_multihopBfd: "False"
21+
neighbor_remoteAS: 100
22+
neighbor_singlehopBfd: "False"

plugins/module_utils/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _check_create_resource_params(resource_name, resource_module_params, action=
246246

247247
for key in resource_module_params.keys():
248248
if key in resource_add_keys:
249-
keylist = key.split(".")
249+
keylist = key.split("_")
250250
current_dict = post_data["routerDynamicRouting"][resource_name]
251251
for i, k in enumerate(keylist):
252252
if i == len(keylist) - 1:

plugins/module_utils/module_executor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def is_resource_identical_nested(self):
396396

397397
def get_nested_value(data, path):
398398
cur = data
399-
for p in path.split('.'):
399+
for p in path.split('_'):
400400
if isinstance(cur, dict) and p in cur:
401401
cur = cur[p]
402402
else:
@@ -507,7 +507,7 @@ def create_or_update(self):
507507

508508
self.module_result["changed"] = True
509509
log(
510-
"INFO: Resource 111 %s:%s does not exist. Will be CREATED."
510+
"INFO: Resource %s:%s does not exist. Will be CREATED."
511511
% (
512512
self.resource_name,
513513
self.resource_id,
@@ -573,7 +573,6 @@ def create_or_update(self):
573573
is_identical, immutable_keys_list = self.is_resource_identical()
574574
log(f"is_identical: {is_identical}")
575575
if is_identical:
576-
log("i am here")
577576
log(
578577
"INFO: Resource `%s:%s` exists and is identical. No change required."
579578
% (
@@ -802,7 +801,6 @@ def update_bindings(
802801
)
803802

804803
else:
805-
log("i am here 222")
806804
log(
807805
"INFO: Resource %s:%s's binding %s:%s exists and is identical. No change required."
808806
% (

plugins/module_utils/nitro_resource_map.py

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16541,28 +16541,28 @@
1654116541
"link": [],
1654216542
"switch": [],
1654316543
"unlink": [],
16544-
"unset": ["commandstring"],
16544+
"unset": [],
1654516545
},
1654616546
"add_payload_keys": [
16547-
"afParams.addressFamily",
16548-
"afParams.redistribute.protocol",
16549-
"afParams.redistribute.routeMap",
16547+
"afParams_addressFamily",
16548+
"afParams_redistribute_protocol",
16549+
"afParams_redistribute_routeMap",
1655016550
"localAS",
16551-
"neighbor.ASOriginationInterval",
16552-
"neighbor.address",
16553-
"neighbor.advertisementInterval",
16554-
"neighbor.afParams.activate",
16555-
"neighbor.afParams.addressFamily",
16556-
"neighbor.afParams.routeMap.direction",
16557-
"neighbor.afParams.routeMap.name",
16558-
"neighbor.connectTimer",
16559-
"neighbor.holdTimerConfig",
16560-
"neighbor.keepaliveTimerConfig",
16561-
"neighbor.md5Password",
16562-
"neighbor.multihopBfd",
16563-
"neighbor.remoteAS",
16564-
"neighbor.singlehopBfd",
16565-
"neighbor.updateSource",
16551+
"neighbor_ASOriginationInterval",
16552+
"neighbor_address",
16553+
"neighbor_advertisementInterval",
16554+
"neighbor_afParams_activate",
16555+
"neighbor_afParams_addressFamily",
16556+
"neighbor_afParams_routeMap_direction",
16557+
"neighbor_afParams_routeMap_name",
16558+
"neighbor_connectTimer",
16559+
"neighbor_holdTimerConfig",
16560+
"neighbor_keepaliveTimerConfig",
16561+
"neighbor_md5Password",
16562+
"neighbor_multihopBfd",
16563+
"neighbor_remoteAS",
16564+
"neighbor_singlehopBfd",
16565+
"neighbor_updateSource",
1656616566
"routerId",
1656716567
],
1656816568
"bindings": [],
@@ -16576,12 +16576,12 @@
1657616576
"primary_key": "",
1657716577
"primary_key_composite": [],
1657816578
"readwrite_arguments": {
16579-
"afParams.addressFamily": {
16579+
"afParams_addressFamily": {
1658016580
"choices": ["ipv4", "ipv6"],
1658116581
"no_log": False,
1658216582
"type": "str",
1658316583
},
16584-
"afParams.redistribute.protocol": {
16584+
"afParams_redistribute_protocol": {
1658516585
"choices": [
1658616586
"connected",
1658716587
"intranet",
@@ -16594,31 +16594,31 @@
1659416594
"no_log": False,
1659516595
"type": "str",
1659616596
},
16597-
"afParams.redistribute.routeMap": {"no_log": False, "type": "str"},
16597+
"afParams_redistribute_routeMap": {"no_log": False, "type": "str"},
1659816598
"localAS": {"no_log": False, "type": "int"},
16599-
"neighbor.ASOriginationInterval": {"no_log": False, "type": "int"},
16600-
"neighbor.address": {"no_log": False, "type": "str"},
16601-
"neighbor.advertisementInterval": {"no_log": False, "type": "int"},
16602-
"neighbor.afParams.activate": {"no_log": False, "type": "bool"},
16603-
"neighbor.afParams.addressFamily": {
16599+
"neighbor_ASOriginationInterval": {"no_log": False, "type": "int"},
16600+
"neighbor_address": {"no_log": False, "type": "str"},
16601+
"neighbor_advertisementInterval": {"no_log": False, "type": "int"},
16602+
"neighbor_afParams_activate": {"no_log": False, "type": "bool"},
16603+
"neighbor_afParams_addressFamily": {
1660416604
"choices": ["ipv4", "ipv6"],
1660516605
"no_log": False,
1660616606
"type": "str",
1660716607
},
16608-
"neighbor.afParams.routeMap.direction": {
16608+
"neighbor_afParams_routeMap_direction": {
1660916609
"choices": ["in", "out"],
1661016610
"no_log": False,
1661116611
"type": "str",
1661216612
},
16613-
"neighbor.afParams.routeMap.name": {"no_log": False, "type": "str"},
16614-
"neighbor.connectTimer": {"no_log": False, "type": "int"},
16615-
"neighbor.holdTimerConfig": {"no_log": False, "type": "int"},
16616-
"neighbor.keepaliveTimerConfig": {"no_log": False, "type": "int"},
16617-
"neighbor.md5Password": {"no_log": True, "type": "str"},
16618-
"neighbor.multihopBfd": {"no_log": False, "type": "bool"},
16619-
"neighbor.remoteAS": {"no_log": False, "type": "int"},
16620-
"neighbor.singlehopBfd": {"no_log": False, "type": "bool"},
16621-
"neighbor.updateSource": {"no_log": False, "type": "str"},
16613+
"neighbor_afParams_routeMap_name": {"no_log": False, "type": "str"},
16614+
"neighbor_connectTimer": {"no_log": False, "type": "int"},
16615+
"neighbor_holdTimerConfig": {"no_log": False, "type": "int"},
16616+
"neighbor_keepaliveTimerConfig": {"no_log": False, "type": "int"},
16617+
"neighbor_md5Password": {"no_log": True, "type": "str"},
16618+
"neighbor_multihopBfd": {"no_log": False, "type": "bool"},
16619+
"neighbor_remoteAS": {"no_log": False, "type": "int"},
16620+
"neighbor_singlehopBfd": {"no_log": False, "type": "bool"},
16621+
"neighbor_updateSource": {"no_log": False, "type": "str"},
1662216622
"routerId": {"no_log": False, "type": "str"},
1662316623
},
1662416624
"singleton": False,

plugins/modules/bgprouter.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
- When C(present), the resource will be added or updated.
3535
- When C(absent), the resource will be deleted.
3636
37-
afParams.addressFamily:
37+
afParams_addressFamily:
3838
type: str
3939
choices: ["ipv4", "ipv6"]
4040
description:
4141
- Address family for this BGP AF parameter.
4242
43-
afParams.redistribute.protocol:
43+
afParams_redistribute_protocol:
4444
type: str
4545
choices: ["kernel", "connected", "static", "rip", "ospf", "isis", "intranet"]
4646
description:
4747
- The protocol from which routes need to be redistributed.
4848
49-
afParams.redistribute.routeMap:
49+
afParams_redistribute_routeMap:
5050
type: str
5151
description:
5252
- Route map reference.
@@ -61,80 +61,80 @@
6161
description:
6262
- Router ID in IP address format.
6363
64-
neighbor.ASOriginationInterval:
64+
neighbor_ASOriginationInterval:
6565
type: int
6666
description:
6767
- Minimum interval between sending AS-origination routing updates.
6868
69-
neighbor.address:
69+
neighbor_address:
7070
type: str
7171
description:
7272
- Address of the neighboring router.
7373
74-
neighbor.advertisementInterval:
74+
neighbor_advertisementInterval:
7575
type: int
7676
description:
7777
- Minimum interval between sending BGP routing updates.
7878
79-
neighbor.afParams.activate:
79+
neighbor_afParams_activate:
8080
type: bool
8181
description:
8282
- Enable the Address Family for the neighbor.
8383
84-
neighbor.afParams.addressFamily:
84+
neighbor_afParams_addressFamily:
8585
type: str
8686
choices: ["ipv4", "ipv6"]
8787
description:
8888
- Address family identifier.
8989
90-
neighbor.afParams.routeMap.direction:
90+
neighbor_afParams_routeMap_direction:
9191
type: str
9292
choices: ["in", "out"]
9393
description:
9494
- Apply the route-map to incoming or outgoing routes.
9595
96-
neighbor.afParams.routeMap.name:
96+
neighbor_afParams_routeMap_name:
9797
type: str
9898
description:
9999
- Name of the route map.
100100
101-
neighbor.connectTimer:
101+
neighbor_connectTimer:
102102
type: int
103103
description:
104104
- Time interval (in seconds) for the ConnectRetry timer.
105105
106-
neighbor.holdTimerConfig:
106+
neighbor_holdTimerConfig:
107107
type: int
108108
description:
109109
- Hold timer value for the neighbor in seconds.
110110
111-
neighbor.keepaliveTimerConfig:
111+
neighbor_keepaliveTimerConfig:
112112
type: int
113113
description:
114114
- Keepalive timer value for the neighbor in seconds.
115115
116-
neighbor.md5Password:
116+
neighbor_md5Password:
117117
type: str
118118
description:
119119
- MD5 password used for neighbor authentication.
120120
no_log: true
121121
122-
neighbor.multihopBfd:
122+
neighbor_multihopBfd:
123123
type: bool
124124
description:
125125
- Enable BFD for multihop BGP sessions.
126126
127-
neighbor.remoteAS:
127+
neighbor_remoteAS:
128128
type: int
129129
description:
130130
- Remote AS number for the neighbor.
131131
132-
neighbor.singlehopBfd:
132+
neighbor_singlehopBfd:
133133
type: bool
134134
description:
135135
- Enable BFD on this neighbor.
136136
137-
neighbor.updateSource:
137+
neighbor_updateSource:
138138
type: str
139139
description:
140140
- Source of routing updates.
@@ -151,18 +151,18 @@
151151
netscaler.adc.bgpRouter:
152152
state: present
153153
localAS: 10
154-
afParams.addressFamily: "ipv4"
155-
afParams.redistribute.protocol: "kernel"
154+
afParams_addressFamily: "ipv4"
155+
afParams_redistribute_protocol: "kernel"
156156
routerId: "10.102.201.219"
157-
neighbor.ASOriginationInterval: 15
158-
neighbor.address: "2.2.12.30"
159-
neighbor.advertisementInterval: 30
160-
neighbor.afParams.addressFamily: "ipv4"
161-
neighbor.holdTimerConfig: 90
162-
neighbor.keepaliveTimerConfig: 30
163-
neighbor.multihopBfd: "False"
164-
neighbor.remoteAS: 100
165-
neighbor.singlehopBfd: "False"
157+
neighbor_ASOriginationInterval: 15
158+
neighbor_address: "2.2.12.30"
159+
neighbor_advertisementInterval: 30
160+
neighbor_afParams_addressFamily: "ipv4"
161+
neighbor_holdTimerConfig: 90
162+
neighbor_keepaliveTimerConfig: 30
163+
neighbor_multihopBfd: "False"
164+
neighbor_remoteAS: 100
165+
neighbor_singlehopBfd: "False"
166166
"""
167167
RETURN = r"""
168168
---

0 commit comments

Comments
 (0)