More gracefully handle none selectors

Allow selection of "none" as the node selector, and handle this by
always using the cluster default instead of writing it in.
This commit is contained in:
2021-06-01 11:05:15 -04:00
parent a0b9087167
commit a48bf2d71e
6 changed files with 29 additions and 21 deletions

View File

@ -160,10 +160,9 @@ def findTargetNode(zk_conn, config, logger, dom_uuid):
except Exception:
search_field = None
# If our search field is invalid, use and set the default (for next time)
# If our search field is invalid, use the default
if search_field is None or search_field == 'None':
search_field = config['migration_target_selector']
zkhandler.writedata(zk_conn, {'/domains/{}/node_selector'.format(dom_uuid): config['migration_target_selector']})
search_field = zkhandler.readdata(zk_conn, '/config/migration_target_selector')
if config['debug']:
logger.out('Migrating VM {} with selector {}'.format(dom_uuid, search_field), state='d', prefix='node-flush')