The existence check of the destination volume group is wrong. It
currently checks if there's a VG with a name equal to the source's vg
name instead of checking if it's equal to the dest_vg.
Closes-bug: #
1258203
Change-Id: Ia5d4acb24b94c6aa832107c7eb4b6996985af97f
pass
def get_all_volume_groups():
- return [{'name': 'cinder-volumes-2'},
- {'name': 'cinder-volumes'}]
+ # NOTE(flaper87) Return just the destination
+ # host to test the check of dest VG existence.
+ return [{'name': 'cinder-volumes-2'}]
self.stubs.Set(self.volume.driver, '_execute', fake_execute)
if dest_vg != self.vg.vg_name:
vg_list = volutils.get_all_volume_groups()
vg_dict = \
- (vg for vg in vg_list if vg['name'] == self.vg.vg_name).next()
+ (vg for vg in vg_list if vg['name'] == dest_vg).next()
if vg_dict is None:
message = ("Destination Volume Group %s does not exist" %
dest_vg)