Skip to content

Commit 7e98be3

Browse files
authored
fix(validate): honor delete operations (#38)
Validate documents a delete parameter but read an undeclared deletes key, so delete operations were omitted from the JSON-RPC validate command list. Read the documented key and build validate commands in the same order config applies them.
1 parent f4ca5ce commit 7e98be3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

plugins/modules/validate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,19 @@ def main():
138138
client = JSONRPCClient(module)
139139

140140
updates = module.params.get("update") or []
141-
deletes = module.params.get("deletes") or []
141+
deletes = module.params.get("delete") or []
142142
replaces = module.params.get("replace") or []
143143
yang_models = module.params.get("yang_models")
144144

145145
commands = []
146-
for obj in updates:
147-
obj["action"] = "update"
146+
for obj in deletes:
147+
obj["action"] = "delete"
148148
commands += [obj]
149149
for obj in replaces:
150150
obj["action"] = "replace"
151151
commands += [obj]
152-
for obj in deletes:
153-
obj["action"] = "delete"
152+
for obj in updates:
153+
obj["action"] = "update"
154154
commands += [obj]
155155

156156
data = {

0 commit comments

Comments
 (0)