Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

De-duplicate networks in provisioning request #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

De-duplicate networks in provisioning request #158

wants to merge 1 commit into from

Conversation

zhiyanliu
Copy link
Contributor

In some particular cases end user could provide duplicated networks in
provisioning request by horizion with softlayer network environment, the
change de-duplicate these duplicated network ids and make softlayer
provision the server(s) with proper network(s).

Signed-off-by: Zhi Yan Liu [email protected]

@jimlindeman
Copy link
Contributor

So the requirement in these parameters is still that there be at most two unique networks (1 private always, and optional public) and the private network must be first in the list. I'm fine with that if it makes Horizon happy. +1

@@ -287,18 +287,22 @@ def _handle_network(self, payload, client, networks):
4) --net-id=<private id> --net-id=<public id>
"""

if len(networks) > 2:
# De-duplicate requested networks
nets = []
Copy link
Member

Choose a reason for hiding this comment

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

networks and nets seem too similar here, perhaps unique_nets would be more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, let me rename it.

Thanks for all your reviews and inputs, @jimlindeman @briancline .

In some particular cases end user could provide duplicated networks in
provisioning request by horizion with softlayer network environment, the
change de-duplicate these duplicated network ids and make softlayer
provision the server(s) with proper network(s).

Signed-off-by: Zhi Yan Liu <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants