fix OpenStack_2_NodeDriver.detach_volume#1267
Merged
asfgit merged 1 commit intoapache:trunkfrom May 26, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## trunk #1267 +/- ##
=========================================
- Coverage 85.91% 85.9% -0.01%
=========================================
Files 356 356
Lines 73444 73456 +12
Branches 6653 6655 +2
=========================================
+ Hits 63099 63105 +6
- Misses 7689 7694 +5
- Partials 2656 2657 +1
Continue to review full report at Codecov.
|
Member
Author
|
@micafer could you take a look at this one? |
micafer
reviewed
Dec 19, 2018
| if not ex_node or ex_node.id == attachment['serverId']: | ||
| if not ex_node or ex_node.id == attachment.get( | ||
| 'serverId' | ||
| ) or attachment['server_id']: |
Contributor
There was a problem hiding this comment.
This comparison is not correct.
In case of passing an ex_node, if attachment['server_id'] is not None, the attachment is deleted using any node.
It should be something like:
if not ex_node or ex_node.id in [attachment.get('serverId'), attachment['server_id']]
Member
Author
There was a problem hiding this comment.
oops, good catch! I'll fix that
a825d14 to
1b5742c
Compare
Member
Author
1b5742c to
5c75064
Compare
Merged
Since apache#1242 the OpenStack_2_NodeDriver uses a volume object returned via volumev2_connection. This object will not contain serverId but server_id. This PR makes the detach_volume method compatible with v2 volumes. Fixes: ``` return connection.detach_volume(volume) File "/usr/local/venv/project/src/apache-libcloud/libcloud/compute/drivers/openstack.py", line 328, in detach_volume (attachment['serverId'], attachment['id']), KeyError: 'serverId' ```
5c75064 to
7b3db0e
Compare
Contributor
|
@micafer please could you review the changes again |
asfgit
pushed a commit
that referenced
this pull request
May 26, 2019
…thub.com/vdloo/libcloud into vdloo-fix-detach-volume-OpenStack_2_NodeDriver Resolves #1267
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.
Since #1242 the OpenStack_2_NodeDriver uses a volume object returned via volumev2_connection. This object will not contain serverId but server_id. This PR makes the detach_volume method compatible with v2 volumes.
Fixes: