Add ex_get_network to openstack driver#1474
Merged
Kami merged 2 commits intoapache:trunkfrom Jul 16, 2020
Merged
Conversation
Member
|
Tested both the v1 and v2 driver, both work fine: The OpenStack_1_1_NodeDriver: In [12]: conn.__class__.__bases__
Out[12]: (libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver,)
In [13]: network_id = conn.ex_list_networks()[0].id
In [14]: conn.ex_get_network(network_id)
Out[14]: <OpenStackNetwork id="123c6b6a-1234-3a1f-b404-1234365f4b22" name="L2_NETWORK" cidr="None">The OpenStack_2_NodeDriver: In [3]: conn.__class__.__bases__
Out[3]: (libcloud.compute.drivers.openstack.OpenStack_2_NodeDriver,)
In [4]: network_id = conn.ex_list_networks()[0].id
In [5]: conn.ex_get_network(network_id)
Out[5]: <OpenStackNetwork id="123c6b6a-1234-3a1f-b404-1234365f4b22" name="L2_NETWORK" cidr="None">The failing tests (scrape-and-publish-provider-prices) are unrelated. lgtm 👍 |
daeaa76 to
3a6d898
Compare
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently to retrieve a network from the OpenStack all networks need to be received. Then these can be filtered by ID. If the ID of the network is known it is not needed to retrieve all networks from the OpenStack.
By creating a function called
ex_get_networkand passing an ID we could retrieve a single network, this would increase performance for some systems. This function works similar toex_get_volume.fixes #1473
Status
Checklist (tick everything that applies)