Commit 104ebd1a by Czémán Arnold

small fix

parent bc83f8c2
...@@ -36,10 +36,7 @@ class CephConnection: ...@@ -36,10 +36,7 @@ class CephConnection:
def sudo(*args): def sudo(*args):
try: subprocess.check_output(["/bin/sudo"] + list(args))
subprocess.check_output(["/bin/sudo"] + list(args))
except subprocess.CalledProcessError as e:
raise Exception(e)
def map_rbd(ceph_path, local_path): def map_rbd(ceph_path, local_path):
......
...@@ -241,14 +241,9 @@ class VMDisk(object): ...@@ -241,14 +241,9 @@ class VMDisk(object):
class CephVMDisk(VMDisk): class CephVMDisk(VMDisk):
'''Virtual MAchine disk over Ceph block representing class '''Class representing Virtual Machine disk over a Ceph block device
''' '''
hosts = None
protocol = None
ceph_user = None
secret_uuid = None
def __init__(self, def __init__(self,
source, source,
hosts, hosts,
......
...@@ -318,7 +318,6 @@ def suspend(name): ...@@ -318,7 +318,6 @@ def suspend(name):
Return the domain info dict. Return the domain info dict.
""" """
domain = lookupByName(name) domain = lookupByName(name)
domain.suspend() domain.suspend()
return _parse_info(domain.info()) return _parse_info(domain.info())
...@@ -333,7 +332,7 @@ def save(name, data_store_type, dir, filename): ...@@ -333,7 +332,7 @@ def save(name, data_store_type, dir, filename):
if data_store_type == "ceph_block": if data_store_type == "ceph_block":
ceph.save(domain, dir, filename) ceph.save(domain, dir, filename)
else: else:
path = dir + "/" + filename path = os.path.join(dir, filename)
domain.save(path) domain.save(path)
...@@ -351,7 +350,7 @@ def restore(name, data_store_type, dir, filename): ...@@ -351,7 +350,7 @@ def restore(name, data_store_type, dir, filename):
if data_store_type == "ceph_block": if data_store_type == "ceph_block":
ceph.restore(Connection.get(), dir, filename) ceph.restore(Connection.get(), dir, filename)
else: else:
path = dir + "/" + filename path = os.path.join(dir, filename)
Connection.get().restore(path) Connection.get().restore(path)
return domain_info(name) return domain_info(name)
...@@ -564,7 +563,6 @@ def migrate(name, host, live=False): ...@@ -564,7 +563,6 @@ def migrate(name, host, live=False):
def attach_disk(name, disk_desc): def attach_disk(name, disk_desc):
""" Attach Disk to a running virtual machine. """ """ Attach Disk to a running virtual machine. """
domain = lookupByName(name) domain = lookupByName(name)
disk = None
if disk_desc["data_store_type"] == "ceph_block": if disk_desc["data_store_type"] == "ceph_block":
disk = CephVMDisk.deserialize(disk_desc) disk = CephVMDisk.deserialize(disk_desc)
else: else:
...@@ -578,7 +576,6 @@ def attach_disk(name, disk_desc): ...@@ -578,7 +576,6 @@ def attach_disk(name, disk_desc):
def detach_disk(name, disk_desc): def detach_disk(name, disk_desc):
""" Detach disk from a running virtual machine. """ """ Detach disk from a running virtual machine. """
domain = lookupByName(name) domain = lookupByName(name)
disk = None
if disk_desc["data_store_type"] == "ceph_block": if disk_desc["data_store_type"] == "ceph_block":
disk = CephVMDisk.deserialize(disk_desc) disk = CephVMDisk.deserialize(disk_desc)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment