fix bugs
This commit is contained in:
parent
8323cb62d4
commit
8e98be274c
|
@ -442,11 +442,7 @@ def migrate_host(user, beans, form):
|
||||||
|
|
||||||
if src_host is None or dst_host_list is None:
|
if src_host is None or dst_host_list is None:
|
||||||
return json.dumps({'success':'false', 'message': 'src host or dst host list is null'})
|
return json.dumps({'success':'false', 'message': 'src host or dst host list is null'})
|
||||||
logger.info(str(src_host))
|
[status, msg] = G_vclustermgr.migrate_host(src_host, dst_host_list)
|
||||||
logger.info(type(dst_host_list))
|
|
||||||
logger.info(str(dst_host_list))
|
|
||||||
#[status, msg] = G_vclustermgr.migrate_host(src_host, dst_host_list)
|
|
||||||
status = True
|
|
||||||
if status:
|
if status:
|
||||||
return json.dumps({'success': 'true', 'action': 'migrate_host'})
|
return json.dumps({'success': 'true', 'action': 'migrate_host'})
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -796,7 +796,7 @@ class VclusterMgr(object):
|
||||||
prestatus = info['status']
|
prestatus = info['status']
|
||||||
self.stop_cluster(clustername, username)
|
self.stop_cluster(clustername, username)
|
||||||
for container in info['containers']:
|
for container in info['containers']:
|
||||||
if container['host'] == src_host:
|
if not container['host'] == src_host:
|
||||||
continue
|
continue
|
||||||
random.shuffle(new_host_list)
|
random.shuffle(new_host_list)
|
||||||
for new_host in new_host_list:
|
for new_host in new_host_list:
|
||||||
|
@ -817,7 +817,9 @@ class VclusterMgr(object):
|
||||||
return [True, ""]
|
return [True, ""]
|
||||||
|
|
||||||
def migrate_host(self, src_host, new_host_list):
|
def migrate_host(self, src_host, new_host_list):
|
||||||
vcluster_list = self.get_all_clusterinfo()
|
[status, vcluster_list] = self.get_all_clusterinfo()
|
||||||
|
if not status:
|
||||||
|
return [False, vcluster_list]
|
||||||
auth_key = env.getenv('AUTH_KEY')
|
auth_key = env.getenv('AUTH_KEY')
|
||||||
res = post_to_user("/master/user/groupinfo/", {'auth_key':auth_key})
|
res = post_to_user("/master/user/groupinfo/", {'auth_key':auth_key})
|
||||||
groups = json.loads(res['groups'])
|
groups = json.loads(res['groups'])
|
||||||
|
|
Loading…
Reference in New Issue