Skip to content

Commit 1a87045

Browse files
committed
Merge pull request #10 from emcvipr/feature-2.2SP1
minor fix related to snapshots obj_id tag
2 parents 9fe4a62 + af55ce1 commit 1a87045

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cinder/volume/drivers/emc/vipr/common.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,15 @@ def _get_vipr_snapshot_name(self, snapshot, resUri):
11761176
self.configuration.vipr_hostname,
11771177
self.configuration.vipr_port)
11781178

1179+
#if the result is empty, then search with the tagname as "OpenStack:obj_id"
1180+
#as snapshots will be having the obj_id instead of just id.
1181+
if( (rslt is None) or (len(rslt) == 0) ):
1182+
tagname = "OpenStack:obj_id:"+ snapshot['id']
1183+
rslt = vipr_utils.search_by_tag(
1184+
vipr_snap.Snapshot.URI_SEARCH_SNAPSHOT_BY_TAG.format(tagname),
1185+
self.configuration.vipr_hostname,
1186+
self.configuration.vipr_port)
1187+
11791188
if( (rslt is None) or (len(rslt) == 0) ):
11801189
return snapshot['name']
11811190
else:

0 commit comments

Comments
 (0)