def ui_command_create(self, name, dev): ''' Creates an IBlock Storage object. I{dev} is the path to the TYPE_DISK block device to use. ''' self.assert_root() self.assert_available_so_name(name) backstore = IBlockBackstore(self.next_hba_index(), mode='create') try: so = IBlockStorageObject(backstore, name, dev) except Exception, exception: backstore.delete() raise exception
def ui_command_create(self, name, dev, generate_wwn=None): ''' Creates an IBlock Storage object. I{dev} is the path to the TYPE_DISK block device to use and the optional I{generate_wwn} parameter is a boolean specifying whether or not we should generate a T10 wwn Serial for the unit (by default, yes). ''' self.assert_root() self.assert_available_so_name(name) backstore = IBlockBackstore(self.next_hba_index(), mode='create') try: so = IBlockStorageObject(backstore, name, dev, self.prm_gen_wwn(generate_wwn)) except Exception, exception: backstore.delete() raise exception