diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-02-01 22:45:32 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-02-01 22:45:32 +0000 |
| commit | a2c31feceaceef686f8c82ee1fc97df4a3635cff (patch) | |
| tree | 525b47d0d9c390cfa71a0fa6d8618d0c620e9696 | |
| parent | a7004dee703908eaa51bb0c3765a0d877afdd2a1 (diff) | |
| parent | ea2c8c8b363dceb3c73be8f02f078d7b78b2c712 (diff) | |
Merge "Fix multinode libvirt volume attachment lp #922232"
| -rw-r--r-- | nova/virt/libvirt/volume.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nova/virt/libvirt/volume.py b/nova/virt/libvirt/volume.py index d93680d59..2bcf60d72 100644 --- a/nova/virt/libvirt/volume.py +++ b/nova/virt/libvirt/volume.py @@ -106,12 +106,11 @@ class LibvirtISCSIVolumeDriver(LibvirtVolumeDriver): def connect_volume(self, connection_info, mount_device): """Attach the volume to instance_name""" iscsi_properties = connection_info['data'] - try: - # NOTE(vish): if we are on the same host as nova volume, the - # discovery makes the target so we don't need to - # run --op new - self._run_iscsiadm(iscsi_properties, ()) - except exception.ProcessExecutionError: + # NOTE(vish): if we are on the same host as nova volume, the + # discovery makes the target so we don't need to + # run --op new + (out, err) = self._run_iscsiadm(iscsi_properties, ()) + if err and err.strip() == "iscsiadm: no records found!": self._run_iscsiadm(iscsi_properties, ('--op', 'new')) if iscsi_properties.get('auth_method'): |
