Skip to content

Commit 9ebae03

Browse files
committed
Sanity errors
1 parent 322b0af commit 9ebae03

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

plugins/modules/dcnm_fabric_member.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@
124124
from ..module_utils.msd.delete_child_fab import childFabricDelete
125125
from ..module_utils.msd.add_child_fab import childFabricAdd
126126
from ..module_utils.msd.fabric_associations import FabricAssociations
127-
from ..module_utils.fabric.verify_playbook_params import VerifyPlaybookParams
128127
from ..module_utils.network.dcnm.dcnm import validate_list_of_dicts
129128

129+
130130
@Properties.add_rest_send
131131
class childCommon():
132132
"""
@@ -217,25 +217,19 @@ def verify_child_fabric_is_already_member(self, item) -> bool:
217217
if (self.data[fabric]['fabricParent'] == item["destFabric"]):
218218
return True
219219
return False
220-
220+
221221
def validate_input(self):
222-
if self.state != "query":
223-
fab_member_spec = dict(
224-
FABRIC_NAME=dict(required=True, type="str"),
225-
CHILD_FABRIC_NAME=dict(required=True, type="str"),
226-
DEPLOY=dict(type="bool", default=False),
227-
)
228-
else:
229-
fab_member_spec = dict(
230-
FABRIC_NAME=dict(type="str"),
231-
)
222+
method_name = inspect.stack()[0][3]
223+
fab_member_spec = dict(
224+
FABRIC_NAME=dict(required=True, type="str"),
225+
CHILD_FABRIC_NAME=dict(required=True, type="str"),
226+
DEPLOY=dict(type="bool", default=False),
227+
)
232228
fab_mem_info, invalid_params = validate_list_of_dicts(self.config, fab_member_spec, None)
233229
if invalid_params:
234-
mesg = "Invalid parameters in playbook: {0}".format(
235-
"while processing config "
236-
+ "\n".join(invalid_params)
237-
)
238-
raise ValueError(mesg)
230+
msg = "Invalid parameters in playbook: {invalid_params}"
231+
msg += "while processing config \n"
232+
raise ValueError(msg)
239233
for config in self.config:
240234
if not isinstance(config, dict):
241235
msg = f"{self.class_name}.{method_name}: "
@@ -389,7 +383,6 @@ def commit(self) -> None:
389383

390384
msg = f"ENTERED: {self.class_name}.{method_name}"
391385
self.log.debug(msg)
392-
393386
self.validate_input()
394387
self.get_want()
395388

@@ -482,7 +475,7 @@ def commit(self) -> None:
482475
msg = f"ENTERED: {self.class_name}.{method_name}"
483476
self.log.debug(msg)
484477
self.get_controller_version()
485-
### Version validation needs to be added
478+
# Version validation needs to be added
486479
self.validate_input()
487480
self.get_want()
488481

tests/sanity/ignore-2.15.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ plugins/module_utils/common/sender_requests.py import-3.9 # TODO remove this if/
2525
plugins/module_utils/common/sender_requests.py import-3.10 # TODO remove this if/when requests is added to the standard library
2626
plugins/module_utils/common/sender_requests.py import-3.11 # TODO remove this if/when requests is added to the standard library
2727
plugins/modules/dcnm_fabric_member.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
28+
plugins/action/tests/unit/ndfc_pc_members_validate.py action-plugin-docs # action plugin has no matching module to provide documentation

tests/sanity/ignore-2.16.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ plugins/modules/dcnm_log.py validate-modules:missing-gplv3-license # GPLv3 licen
2222
plugins/module_utils/common/sender_requests.py import-3.10 # TODO remove this if/when requests is added to the standard library
2323
plugins/module_utils/common/sender_requests.py import-3.11 # TODO remove this if/when requests is added to the standard library
2424
plugins/modules/dcnm_fabric_member.py validate-modules:missing-gplv3-license # GPLv3 license header not found in the first 20 lines of the module
25+
plugins/action/tests/unit/ndfc_pc_members_validate.py action-plugin-docs # action plugin has no matching module to provide documentation

0 commit comments

Comments
 (0)