Skip to content

Commit 9b72615

Browse files
authored
Fix dcnm_policy delete issue #412 (#421)
* Update dcnm_policy.py * Update dcnm_policy.py Fix whitespace issue * Update dcnm_policy.py Fix trailing whitespace
1 parent 1e56756 commit 9b72615

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

plugins/modules/dcnm_policy.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,11 +1145,15 @@ def dcnm_policy_update_policy(self, policy, command):
11451145
return resp
11461146

11471147
def dcnm_policy_delete_policy(self, policy, mark_del):
1148-
11491148
if mark_del is True:
1150-
path = self.paths["POLICY_DELETE"].format(policy["policyId"])
1151-
json_payload = ""
1152-
command = "DELETE"
1149+
if policy["templateName"] == "switch_freeform":
1150+
path = self.paths["POLICY_DELETE"].format(policy["policyId"])
1151+
json_payload = ""
1152+
command = "DELETE"
1153+
else:
1154+
path = self.paths["POLICY_MARK_DELETE"].format(policy["policyId"])
1155+
json_payload = ""
1156+
command = "PUT"
11531157
else:
11541158
path = self.paths["POLICY_WITH_POLICY_ID"].format(policy)
11551159
json_payload = ""

0 commit comments

Comments
 (0)