Skip to content

cs_project.py: pass cleanup=true in deleteProject API#122

Merged
resmo merged 2 commits intongine-io:masterfrom
yadvr:patch-1
Jun 7, 2023
Merged

cs_project.py: pass cleanup=true in deleteProject API#122
resmo merged 2 commits intongine-io:masterfrom
yadvr:patch-1

Conversation

@yadvr
Copy link
Copy Markdown
Contributor

@yadvr yadvr commented Jun 5, 2023

Pass cleanup=true in the delete project module, refer:
https://cloudstack.apache.org/api/apidocs-4.18/apis/deleteProject.html

@yadvr
Copy link
Copy Markdown
Contributor Author

yadvr commented Jun 5, 2023

cc @resmo

Copy link
Copy Markdown

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

the new flag was introduced in cloudstack 4.16, which breaks backwards compatibility somehow.
apache/cloudstack#4617

@resmo
Copy link
Copy Markdown
Member

resmo commented Jun 5, 2023

@weizhouapache well, didn't test it yet but in the past, cloudstack just ignored unknown flags? So for earlier versions, this shouldn't break backwards compatibility right?

@weizhouapache
Copy link
Copy Markdown

@weizhouapache well, didn't test it yet but in the past, cloudstack just ignored unknown flags? So for earlier versions, this shouldn't break backwards compatibility right?

@resmo
this PR also works with the earlier cloudstack versions which do not support the cleanup flag.

There will be a warning message in log (just a warning) like

Received unknown parameters for command deleteProject. Unknown parameters : cleanup

Comment thread plugins/modules/cs_project.py Outdated
args = {
'id': project['id']
'id': project['id'],
'cleanup': 'true'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be a bool like so 'cleanup': True

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @resmo I can fix that. Does ansible/module, convert boolen True to 'true' string when pass the args in the API call?

Comment thread plugins/modules/cs_project.py Outdated
@yadvr yadvr requested a review from resmo June 5, 2023 12:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (dc89b6d) 83.77% compared to head (ac35926) 83.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #122   +/-   ##
=======================================
  Coverage   83.77%   83.77%           
=======================================
  Files          56       56           
  Lines        5645     5645           
  Branches     1271     1271           
=======================================
  Hits         4729     4729           
  Misses        472      472           
  Partials      444      444           
Impacted Files Coverage Δ
plugins/modules/cs_project.py 83.72% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants