Commit 588d1da3 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix parameter formatting.

Reviewed-by: iustinp
parent 28cc354f
...@@ -79,7 +79,7 @@ class ServerObject(pb.Avatar): ...@@ -79,7 +79,7 @@ class ServerObject(pb.Avatar):
# the new block devices -------------------------- # the new block devices --------------------------
def perspective_blockdev_create(self,params): def perspective_blockdev_create(self, params):
bdev_s, size, on_primary = params bdev_s, size, on_primary = params
bdev = objects.ConfigObject.Loads(bdev_s) bdev = objects.ConfigObject.Loads(bdev_s)
if bdev is None: if bdev is None:
...@@ -87,13 +87,13 @@ class ServerObject(pb.Avatar): ...@@ -87,13 +87,13 @@ class ServerObject(pb.Avatar):
return backend.CreateBlockDevice(bdev, size, on_primary) return backend.CreateBlockDevice(bdev, size, on_primary)
def perspective_blockdev_remove(self,params): def perspective_blockdev_remove(self, params):
bdev_s = params[0] bdev_s = params[0]
bdev = objects.ConfigObject.Loads(bdev_s) bdev = objects.ConfigObject.Loads(bdev_s)
return backend.RemoveBlockDevice(bdev) return backend.RemoveBlockDevice(bdev)
def perspective_blockdev_assemble(self,params): def perspective_blockdev_assemble(self, params):
bdev_s, on_primary = params bdev_s, on_primary = params
bdev = objects.ConfigObject.Loads(bdev_s) bdev = objects.ConfigObject.Loads(bdev_s)
if bdev is None: if bdev is None:
...@@ -101,7 +101,7 @@ class ServerObject(pb.Avatar): ...@@ -101,7 +101,7 @@ class ServerObject(pb.Avatar):
return backend.AssembleBlockDevice(bdev, on_primary) return backend.AssembleBlockDevice(bdev, on_primary)
def perspective_blockdev_shutdown(self,params): def perspective_blockdev_shutdown(self, params):
bdev_s = params[0] bdev_s = params[0]
bdev = objects.ConfigObject.Loads(bdev_s) bdev = objects.ConfigObject.Loads(bdev_s)
if bdev is None: if bdev is None:
...@@ -109,7 +109,7 @@ class ServerObject(pb.Avatar): ...@@ -109,7 +109,7 @@ class ServerObject(pb.Avatar):
return backend.ShutdownBlockDevice(bdev) return backend.ShutdownBlockDevice(bdev)
def perspective_blockdev_addchild(self,params): def perspective_blockdev_addchild(self, params):
bdev_s, ndev_s = params bdev_s, ndev_s = params
bdev = objects.ConfigObject.Loads(bdev_s) bdev = objects.ConfigObject.Loads(bdev_s)
ndev = objects.ConfigObject.Loads(ndev_s) ndev = objects.ConfigObject.Loads(ndev_s)
...@@ -118,7 +118,7 @@ class ServerObject(pb.Avatar): ...@@ -118,7 +118,7 @@ class ServerObject(pb.Avatar):
return backend.MirrorAddChild(bdev, ndev) return backend.MirrorAddChild(bdev, ndev)
def perspective_blockdev_removechild(self,params): def perspective_blockdev_removechild(self, params):
bdev_s, ndev_s = params bdev_s, ndev_s = params
bdev = objects.ConfigObject.Loads(bdev_s) bdev = objects.ConfigObject.Loads(bdev_s)
ndev = objects.ConfigObject.Loads(ndev_s) ndev = objects.ConfigObject.Loads(ndev_s)
...@@ -135,25 +135,25 @@ class ServerObject(pb.Avatar): ...@@ -135,25 +135,25 @@ class ServerObject(pb.Avatar):
disk = objects.ConfigObject.Loads(params[0]) disk = objects.ConfigObject.Loads(params[0])
return backend.FindBlockDevice(disk) return backend.FindBlockDevice(disk)
def perspective_blockdev_snapshot(self,params): def perspective_blockdev_snapshot(self, params):
cfbd = objects.ConfigObject.Loads(params[0]) cfbd = objects.ConfigObject.Loads(params[0])
return backend.SnapshotBlockDevice(cfbd) return backend.SnapshotBlockDevice(cfbd)
# export/import -------------------------- # export/import --------------------------
def perspective_snapshot_export(self,params): def perspective_snapshot_export(self, params):
disk = objects.ConfigObject.Loads(params[0]) disk = objects.ConfigObject.Loads(params[0])
dest_node = params[1] dest_node = params[1]
instance = objects.ConfigObject.Loads(params[2]) instance = objects.ConfigObject.Loads(params[2])
return backend.ExportSnapshot(disk,dest_node,instance) return backend.ExportSnapshot(disk,dest_node,instance)
def perspective_finalize_export(self,params): def perspective_finalize_export(self, params):
instance = objects.ConfigObject.Loads(params[0]) instance = objects.ConfigObject.Loads(params[0])
snap_disks = [objects.ConfigObject.Loads(str_data) snap_disks = [objects.ConfigObject.Loads(str_data)
for str_data in params[1]] for str_data in params[1]]
return backend.FinalizeExport(instance, snap_disks) return backend.FinalizeExport(instance, snap_disks)
def perspective_export_info(self,params): def perspective_export_info(self, params):
dir = params[0] dir = params[0]
einfo = backend.ExportInfo(dir) einfo = backend.ExportInfo(dir)
if einfo is None: if einfo is None:
...@@ -169,22 +169,22 @@ class ServerObject(pb.Avatar): ...@@ -169,22 +169,22 @@ class ServerObject(pb.Avatar):
# volume -------------------------- # volume --------------------------
def perspective_volume_list(self,params): def perspective_volume_list(self, params):
vgname = params[0] vgname = params[0]
return backend.GetVolumeList(vgname) return backend.GetVolumeList(vgname)
def perspective_vg_list(self,params): def perspective_vg_list(self, params):
return backend.ListVolumeGroups() return backend.ListVolumeGroups()
# bridge -------------------------- # bridge --------------------------
def perspective_bridges_exist(self,params): def perspective_bridges_exist(self, params):
bridges_list = params[0] bridges_list = params[0]
return backend.BridgesExist(bridges_list) return backend.BridgesExist(bridges_list)
# instance -------------------------- # instance --------------------------
def perspective_instance_os_add(self,params): def perspective_instance_os_add(self, params):
inst_s, os_disk, swap_disk = params inst_s, os_disk, swap_disk = params
inst = objects.ConfigObject.Loads(inst_s) inst = objects.ConfigObject.Loads(inst_s)
return backend.AddOSToInstance(inst, os_disk, swap_disk) return backend.AddOSToInstance(inst, os_disk, swap_disk)
...@@ -195,35 +195,35 @@ class ServerObject(pb.Avatar): ...@@ -195,35 +195,35 @@ class ServerObject(pb.Avatar):
return backend.ImportOSIntoInstance(inst, os_disk, swap_disk, return backend.ImportOSIntoInstance(inst, os_disk, swap_disk,
src_node, src_image) src_node, src_image)
def perspective_instance_shutdown(self,params): def perspective_instance_shutdown(self, params):
instance = objects.ConfigObject.Loads(params[0]) instance = objects.ConfigObject.Loads(params[0])
return backend.ShutdownInstance(instance) return backend.ShutdownInstance(instance)
def perspective_instance_start(self,params): def perspective_instance_start(self, params):
instance = objects.ConfigObject.Loads(params[0]) instance = objects.ConfigObject.Loads(params[0])
extra_args = params[1] extra_args = params[1]
return backend.StartInstance(instance, extra_args) return backend.StartInstance(instance, extra_args)
def perspective_instance_info(self,params): def perspective_instance_info(self, params):
return backend.GetInstanceInfo(params[0]) return backend.GetInstanceInfo(params[0])
def perspective_all_instances_info(self,params): def perspective_all_instances_info(self, params):
return backend.GetAllInstancesInfo() return backend.GetAllInstancesInfo()
def perspective_instance_list(self,params): def perspective_instance_list(self, params):
return backend.GetInstanceList() return backend.GetInstanceList()
# node -------------------------- # node --------------------------
def perspective_node_info(self,params): def perspective_node_info(self, params):
vgname = params[0] vgname = params[0]
return backend.GetNodeInfo(vgname) return backend.GetNodeInfo(vgname)
def perspective_node_add(self,params): def perspective_node_add(self, params):
return backend.AddNode(params[0], params[1], params[2], return backend.AddNode(params[0], params[1], params[2],
params[3], params[4], params[5]) params[3], params[4], params[5])
def perspective_node_verify(self,params): def perspective_node_verify(self, params):
return backend.VerifyNode(params[0]) return backend.VerifyNode(params[0])
def perspective_node_start_master(self, params): def perspective_node_start_master(self, params):
...@@ -240,13 +240,13 @@ class ServerObject(pb.Avatar): ...@@ -240,13 +240,13 @@ class ServerObject(pb.Avatar):
# cluster -------------------------- # cluster --------------------------
def perspective_version(self,params): def perspective_version(self, params):
return constants.PROTOCOL_VERSION return constants.PROTOCOL_VERSION
def perspective_configfile_list(self,params): def perspective_configfile_list(self, params):
return backend.ListConfigFiles() return backend.ListConfigFiles()
def perspective_upload_file(self,params): def perspective_upload_file(self, params):
return backend.UploadFile(*params) return backend.UploadFile(*params)
......
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 to comment