Fix minor bugs
This commit is contained in:
parent
5995353597
commit
8dc0c8f0ac
|
@ -229,7 +229,7 @@ def cli_vm():
|
||||||
help='Method to determine optimal target node during autoselect; saved with VM.'
|
help='Method to determine optimal target node during autoselect; saved with VM.'
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
'-a'/'-A', '--autostart'/'--no-autostart', 'node_autostart', is_flag=True, default=False,
|
'-a/-A', '--autostart/--no-autostart', 'node_autostart', is_flag=True, default=False,
|
||||||
help='Start VM automatically on next unflush/ready state of home node; unset by daemon once used.'
|
help='Start VM automatically on next unflush/ready state of home node; unset by daemon once used.'
|
||||||
)
|
)
|
||||||
@click.argument(
|
@click.argument(
|
||||||
|
@ -262,7 +262,7 @@ def vm_define(config, target_node, node_limit, node_selector, node_autostart):
|
||||||
help='Method to determine optimal target node during autoselect; saved with VM.'
|
help='Method to determine optimal target node during autoselect; saved with VM.'
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
'-a'/'-A', '--autostart'/'--no-autostart', 'node_autostart', is_flag=True, default=None,
|
'-a/-A', '--autostart/--no-autostart', 'node_autostart', is_flag=True, default=None,
|
||||||
help='Start VM automatically on next unflush/ready state of home node; unset by daemon once used.'
|
help='Start VM automatically on next unflush/ready state of home node; unset by daemon once used.'
|
||||||
)
|
)
|
||||||
@click.argument(
|
@click.argument(
|
||||||
|
|
|
@ -164,9 +164,17 @@ def getInformationFromXML(zk_conn, uuid):
|
||||||
domain_lastnode = zkhandler.readdata(zk_conn, '/domains/{}/lastnode'.format(uuid))
|
domain_lastnode = zkhandler.readdata(zk_conn, '/domains/{}/lastnode'.format(uuid))
|
||||||
domain_failedreason = zkhandler.readdata(zk_conn, '/domains/{}/failedreason'.format(uuid))
|
domain_failedreason = zkhandler.readdata(zk_conn, '/domains/{}/failedreason'.format(uuid))
|
||||||
|
|
||||||
|
try:
|
||||||
domain_node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(uuid))
|
domain_node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(uuid))
|
||||||
domain_node_selector = zkhandler.readdata(zk_conn, '/domains/{}/node_selector'.format(uuid))
|
domain_node_selector = zkhandler.readdata(zk_conn, '/domains/{}/node_selector'.format(uuid))
|
||||||
domain_node_autostart = zkhandler.readdata(zk_conn, '/domains/{}/node_autostart'.format(uuid))
|
domain_node_autostart = zkhandler.readdata(zk_conn, '/domains/{}/node_autostart'.format(uuid))
|
||||||
|
except:
|
||||||
|
domain_node_limit = None
|
||||||
|
domain_node_selector = None
|
||||||
|
domain_node_autostart = None
|
||||||
|
|
||||||
|
if not domain_node_limit:
|
||||||
|
domain_node_limit = 'False'
|
||||||
|
|
||||||
parsed_xml = getDomainXML(zk_conn, uuid)
|
parsed_xml = getDomainXML(zk_conn, uuid)
|
||||||
|
|
||||||
|
|
|
@ -707,8 +707,8 @@ def format_info(zk_conn, domain_information, long_output):
|
||||||
ainformation.append('{}Failure reason:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['failed_reason']))
|
ainformation.append('{}Failure reason:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['failed_reason']))
|
||||||
|
|
||||||
ainformation.append('')
|
ainformation.append('')
|
||||||
ainformation.append('{}Node limit:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_limit']))
|
|
||||||
ainformation.append('{}Migration selector:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_selector']))
|
ainformation.append('{}Migration selector:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_selector']))
|
||||||
|
ainformation.append('{}Node limit:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_limit']))
|
||||||
ainformation.append('{}Autostart:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_autostart']))
|
ainformation.append('{}Autostart:{} {}'.format(ansiprint.purple(), ansiprint.end(), domain_information['node_autostart']))
|
||||||
|
|
||||||
# Network list
|
# Network list
|
||||||
|
|
|
@ -94,7 +94,7 @@ def migrateFromFencedNode(zk_conn, node_name, config, logger):
|
||||||
zkhandler.writedata(zk_conn, {
|
zkhandler.writedata(zk_conn, {
|
||||||
'/domains/{}/state'.format(dom_uuid): 'stopped',
|
'/domains/{}/state'.format(dom_uuid): 'stopped',
|
||||||
'/domains/{}/node_autostart'.format(dom_uuid): 'True'
|
'/domains/{}/node_autostart'.format(dom_uuid): 'True'
|
||||||
}
|
})
|
||||||
|
|
||||||
# Set node in flushed state for easy remigrating when it comes back
|
# Set node in flushed state for easy remigrating when it comes back
|
||||||
zkhandler.writedata(zk_conn, { '/nodes/{}/domainstate'.format(node_name): 'flushed' })
|
zkhandler.writedata(zk_conn, { '/nodes/{}/domainstate'.format(node_name): 'flushed' })
|
||||||
|
|
Loading…
Reference in New Issue