def testCreateLVMEnvironment(self):
        try:
            vgname = "test_vg"
            lvname = "test_lv"
            pvname = "/dev/sda"
            print("Creating pv: %s" % pvname)
            _pv = PhysicalVolume(pvname)
            _pv.create()
            print("Creating vg: %s" % vgname)
            _vg = VolumeGroup(vgname, _pv)
            _vg.create()
            _vg.addPhysicalVolume(_pv)
            print("Creating lv: %s" % lvname)
            _lv = LogicalVolume(lvname, _vg)
            _lv.create()
            _vg.addLogicalVolume(_lv)

            print "Volumegroup %s: %s" % (vgname, _vg)

            print("Changing clustered")
            _vg.clustered()
            _vg.notclustered()

            print("Removing lv")
            _lv.remove()
            print("Removing vg")
            _vg.remove()
            print("Removing pv")
            _pv.remove()
        except Exception, e:
            import traceback
            traceback.print_exc()
            self.fail(
                "Caught unexpected exception during lvm environment creation %s."
                % e)
 def testCreateLVMEnvironment(self):
     try:
         vgname="test_vg"
         lvname="test_lv"
         pvname="/dev/sda"
         print("Creating pv: %s" %pvname)
         _pv=PhysicalVolume(pvname)
         _pv.create()
         print("Creating vg: %s" %vgname)
         _vg=VolumeGroup(vgname, _pv)
         _vg.create()
         _vg.addPhysicalVolume(_pv)
         print("Creating lv: %s" %lvname)
         _lv=LogicalVolume(lvname, _vg)
         _lv.create()
         _vg.addLogicalVolume(_lv)
     
         print "Volumegroup %s: %s" %(vgname, _vg)
     
         print("Changing clustered")
         _vg.clustered()
         _vg.notclustered()
     
         print("Removing lv")
         _lv.remove()
         print("Removing vg")
         _vg.remove()
         print("Removing pv")
         _pv.remove()
     except Exception, e:
         import traceback
         traceback.print_exc()
         self.fail("Caught unexpected exception during lvm environment creation %s." %e)