Add attaching state for Volumes
bug 897726 Add "attaching" status for volumes and clear state on error This closes a gap where multiple calls of attach for the same volume can happen before the volume is actually attached. Change-Id: I59d22ceda83729c1a455af9994c9ffec1912e23b
This commit is contained in:
1
Authors
1
Authors
@@ -106,6 +106,7 @@ Kevin L. Mitchell <kevin.mitchell@rackspace.com>
|
||||
Kiall Mac Innes <kiall@managedit.ie>
|
||||
Kirill Shileev <kshileev@gmail.com>
|
||||
Koji Iida <iida.koji@lab.ntt.co.jp>
|
||||
Liam Kelleher <liam.kelleher@hp.com>
|
||||
Likitha Shetty <likitha.shetty@citrix.com>
|
||||
Loganathan Parthipan <parthipan@hp.com>
|
||||
Lorin Hochstein <lorin@isi.edu>
|
||||
|
@@ -127,6 +127,8 @@
|
||||
|
||||
"volume:attach": [],
|
||||
"volume:detach": [],
|
||||
"volume:reserve_volume": [],
|
||||
"volume:unreserve_volume": [],
|
||||
"volume:check_attach": [],
|
||||
"volume:check_detach": [],
|
||||
"volume:initialize_connection": [],
|
||||
|
@@ -3049,12 +3049,16 @@ class ComputeAPITestCase(BaseTestCase):
|
||||
def fake_check_attach(*args, **kwargs):
|
||||
pass
|
||||
|
||||
def fake_reserve_volume(*args, **kwargs):
|
||||
pass
|
||||
|
||||
def fake_volume_get(self, context, volume_id):
|
||||
return {'id': volume_id}
|
||||
|
||||
self.stubs.Set(nova.volume.api.API, 'get', fake_volume_get)
|
||||
self.stubs.Set(nova.volume.api.API, 'check_attach', fake_check_attach)
|
||||
|
||||
self.stubs.Set(nova.volume.api.API, 'reserve_volume',
|
||||
fake_reserve_volume)
|
||||
instance = self._create_fake_instance()
|
||||
self.compute_api.attach_volume(self.context, instance, 1, '/dev/vdb')
|
||||
|
||||
|
Reference in New Issue
Block a user