-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check mode for delete operations #422
base: release/1.9.3
Are you sure you want to change the base?
Conversation
@@ -96,8 +96,15 @@ def delete_image(module, result): | |||
image = Image(module, delete_image=True) | |||
fname = module.params["filename"] | |||
itype = module.params["installer_type"] | |||
|
|||
if module.check_mode: | |||
result["file_name"] = fname |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this ? We are already have file name in response messge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let it be consistent with upload_image()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it should be 'image_name' if required. Add in upload_image() as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use "response" for giving check mode msg. Use "msg" for same. As in some modules "response" will have delete spec which is significant in check mode.
plugins/modules/ntnx_acps.py
Outdated
@@ -466,6 +466,11 @@ def delete_acp(module, result): | |||
result["error"] = "Missing parameter acp_uuid in playbook" | |||
module.fail_json(msg="Failed deleting acp", **result) | |||
|
|||
if module.check_mode: | |||
result["acp_uuid"] = acp_uuid | |||
result["response"] = "Acp with uuid:{0} will be deleted.".format(acp_uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update all reviews
result["response"] = "Acp with uuid:{0} will be deleted.".format(acp_uuid) | |
result["msg"] = "Acp with uuid:{0} will be deleted.".format(acp_uuid) |
@alaa-bish @Gevorg-Khachatryan-97 Please add tests to cover added code changes. |
result["imaged_cluster_uuid"] = cluster_uuid | ||
result["msg"] = "Cluster with uuid:{0} will be deleted.".format(cluster_uuid) | ||
return | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhati-pradeep could not find any test for deletion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhati-pradeep there is no any test for delete stretched vlan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhati-pradeep there is no delete tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhati-pradeep no test
@@ -1499,6 +1499,12 @@ def delete_db_servers(module, result, database_info): | |||
spec = db_servers.get_default_delete_spec( | |||
delete=module.params.get("delete_db_server_vms", False) | |||
) | |||
|
|||
if module.check_mode: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have check_sum for delete_db_servers, as we have it for delete_instance
No description provided.