summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-07-18 19:18:35 +0000
committerGerrit Code Review <review@openstack.org>2017-07-18 19:18:35 +0000
commitdc650c069bd2c2446400e97e734f18278f1b72ac (patch)
tree60fd0810b8264b68930c11df12faf364e546146a
parentda94b56f9e90b1d6ed2ece916adb65d3dc836f10 (diff)
parent0c5b04a59c4da33ebc5780355f3c2277d71f9124 (diff)
downloadglance_store-dc650c069bd2c2446400e97e734f18278f1b72ac.tar.gz
Merge "Cinder driver: TypeError in _open_cinder_volume"
-rw-r--r--glance_store/_drivers/cinder.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/glance_store/_drivers/cinder.py b/glance_store/_drivers/cinder.py
index 42dd58c..7cb9d6a 100644
--- a/glance_store/_drivers/cinder.py
+++ b/glance_store/_drivers/cinder.py
@@ -497,10 +497,13 @@ class Store(glance_store.driver.Store):
device = conn.connect_volume(connection_info['data'])
volume.attach(None, None, attach_mode, host_name=host)
volume = self._wait_volume_status(volume, 'attaching', 'in-use')
- LOG.debug('Opening host device "%s"', device['path'])
- with temporary_chown(device['path']), \
- open(device['path'], mode) as f:
- yield f
+ if (connection_info['driver_volume_type'] == 'rbd' and
+ not conn.do_local_attach):
+ yield device['path']
+ else:
+ with temporary_chown(device['path']), \
+ open(device['path'], mode) as f:
+ yield f
except Exception:
LOG.exception(_LE('Exception while accessing to cinder volume '
'%(volume_id)s.'), {'volume_id': volume.id})