Adds a check to the LVM code in brick to see if
a snapshot exists. This implements the incorrectly
named "is_busy" method that exists in the cinder LVM driver.
Change-Id: Ia0f6cbd3d5b4561c5368545448abaafa67caf05d
self._execute('lvconvert', '--merge',
snapshot_name, root_helper='sudo',
run_as_root=True)
+
+ def lv_has_snapshot(self, name):
+ out, err = self._execute('lvdisplay', '--noheading',
+ '-C', '-o', 'Attr',
+ '%s/%s' % (self.vg_name, name))
+ if out:
+ out = out.strip()
+ if (out[0] == 'o') or (out[0] == 'O'):
+ return True
+ return False