Skip to content
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

[Bug] Scaleway The volume is created systematically on par1 #3964

Merged
merged 11 commits into from
Jan 5, 2022
Merged

Conversation

xilmen
Copy link
Contributor

@xilmen xilmen commented Dec 30, 2021

SUMMARY

Change of organization to project, depreciated in the api.
Added missing region parameter.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

This module allows to create volumes on the scw datacenter

@ansibullbot

This comment has been minimized.

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug cloud module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) labels Dec 30, 2021
@@ -51,10 +51,10 @@
description:
- Name used to identify the volume.
required: true
organization:
project:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a breaking change and will not be accepted. See #3951 for a way to do this as in a non-breaking fashion. It might also be better to rename this option to project and keep an alias for organization, if these two values mean the same to the API. @remyleone what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can indeed follow #3951 to add support for a project. I don't think it is necessary to remove organization. Also, I fail to see why you would need a region argument, instance API uses zone such as fr-par-1 and not region such as fr-par. par1 is deprecated and you should use fr-par-1 to talk about this zone that belongs to the fr-par region.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the changes to support organization

@ansibullbot

This comment has been minimized.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Dec 30, 2021
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Dec 30, 2021
@ansibullbot

This comment has been minimized.

@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Dec 30, 2021
@felixfontein felixfontein added backport-4 check-before-release PR will be looked at again shortly before release and merged if possible. labels Dec 31, 2021
changelogs/fragments/3964-scaleway_volume_add_region.yml Outdated Show resolved Hide resolved
plugins/modules/cloud/scaleway/scaleway_volume.py Outdated Show resolved Hide resolved
plugins/modules/cloud/scaleway/scaleway_volume.py Outdated Show resolved Hide resolved
size = module.params['size']
volume_type = module.params['volume_type']
module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a bugfix? Is it related to the other bugfixes? If not, it should be a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need this part to have the scw aliases. example par1 = fr-par-1

@@ -123,14 +130,20 @@ def core(module):

volumeByName = None
for volume in volumes_json['volumes']:
if volume['project'] == project and volume['name'] == name:
volumeByName = volume

if volume['organization'] == organization and volume['name'] == name:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the API return both organization and project with the same value? Or only one of these two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I check with ansible -vvv i have 2 return from API:
organization: null
project: <ID_project>

So I guess if we pass organization has the place of project. The value of project would be null

xilmen and others added 2 commits December 31, 2021 10:28
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Dec 31, 2021
Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot ansibullbot removed the needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI label Dec 31, 2021
@ansibullbot

This comment has been minimized.

Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Dec 31, 2021
@xilmen xilmen requested a review from felixfontein January 3, 2022 14:43
Co-authored-by: Rémy Léone <remy.leone@gmail.com>
@remyleone
Copy link
Contributor

shipit

@felixfontein
Copy link
Collaborator

In that case, looks good to me as well!

@felixfontein felixfontein merged commit 125516b into ansible-collections:main Jan 5, 2022
@patchback
Copy link

patchback bot commented Jan 5, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/125516b95752153cba8ff2715ccedac6d927bc82/pr-3964

Backported as #3983

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jan 5, 2022
patchback bot pushed a commit that referenced this pull request Jan 5, 2022
* [Bug] The volume is created systematically on par1

* add change log

* added backward compatibility with organization

* add documentation

* change typo doc

* Update changelogs/fragments/3964-scaleway_volume_add_region.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Rémy Léone <remy.leone@gmail.com>

* optimization

Co-authored-by: Romain SCHARFF <rscharff@plussimple.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Rémy Léone <remy.leone@gmail.com>
(cherry picked from commit 125516b)
@felixfontein
Copy link
Collaborator

@xilmen thanks for your contribution!
@remyleone thanks for reviewing!

felixfontein pushed a commit that referenced this pull request Jan 5, 2022
…3983)

* [Bug] The volume is created systematically on par1

* add change log

* added backward compatibility with organization

* add documentation

* change typo doc

* Update changelogs/fragments/3964-scaleway_volume_add_region.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/scaleway/scaleway_volume.py

Co-authored-by: Rémy Léone <remy.leone@gmail.com>

* optimization

Co-authored-by: Romain SCHARFF <rscharff@plussimple.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Rémy Léone <remy.leone@gmail.com>
(cherry picked from commit 125516b)

Co-authored-by: xilmen <romain.scha@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants