def stack(parser): # if node role is "unknow", go back if NODE_ROLE.is_unknown(): LOG.error('Can not confirm the node role!') return if not NODE_ROLE.is_fuel(): if parser.CONTROLLER: if not NODE_ROLE.is_controller(): cmd_warn('controller') return if parser.COMPUTE: if not NODE_ROLE.is_compute(): cmd_warn('compute') return if parser.MONGO: if not NODE_ROLE.is_mongo(): cmd_warn('mongo') return if parser.CONTROLLER or parser.COMPUTE or parser.MONGO: if parser.PROFILE and not parser.SERVICE and not parser.CHECK_ALL: if parser.CONTROLLER: check('controller', 'profile') if parser.COMPUTE: check('compute', 'profile') if parser.MONGO: check('mongo', 'profile') if parser.SERVICE and not parser.PROFILE and not parser.CHECK_ALL: if parser.CONTROLLER: check('controller', 'service') if parser.COMPUTE: check('compute', 'service') if parser.MONGO: check('mongo', 'service') if parser.SERVICE and parser.PROFILE or parser.CHECK_ALL or not parser.PROFILE and not parser.SERVICE: if parser.CONTROLLER: check('controller', 'all') if parser.COMPUTE: check('compute', 'all') if parser.MONGO: check('mongo', 'all') return # check all if parser.CHECK_ALL and parser.PROFILE and parser.SERVICE: check_all() return elif parser.CHECK_ALL and parser.PROFILE: check_all_profile() return elif parser.CHECK_ALL and parser.SERVICE: check_all_service() return elif parser.CHECK_ALL: check_all() return # check profile or service if parser.PROFILE: check_all_profile() if parser.SERVICE: check_all_service()
def init(parser): if NODE_ROLE.is_unknown(): LOG.error("Can not confirm the node role!") if not NODE_ROLE.is_fuel(): LOG.warn("This command can only run on fuel node !") return init_node_list_file() init_node_role_file()
def init(parser): if NODE_ROLE.is_unknown(): LOG.error('Can not confirm the node role!') if not NODE_ROLE.is_fuel(): LOG.warn('This command can only run on fuel node !') return if parser.UPDATE: update() return init_env() init_node_list_file() init_node_role_file()
def init(parser): if NODE_ROLE.is_unknown(): LOG.error('Can not confirm the node role!') if not NODE_ROLE.is_fuel(): LOG.warn('This command can only run on fuel node !') return if parser.UPDATE: update() return init_env() init_node_list_file() init_node_role_file()
def get_node_role(): node_roles = [] if NODE_ROLE.is_unknown(): return node_roles if NODE_ROLE.is_fuel(): node_roles.append('fuel') if NODE_ROLE.is_controller(): node_roles.append('controller') if NODE_ROLE.is_compute(): node_roles.append('compute') if NODE_ROLE.is_ceph_osd(): node_roles.append('ceph_osd') if NODE_ROLE.is_mongo(): node_roles.append('mongo') return node_roles
def env(parser): if NODE_ROLE.is_unknown(): LOG.error('Can not confirm the node role!') return if parser.CHECK_ALL: if not parser.OBJECT_NAME: check_all() else: check_nodes(parser.OBJECT_NAME) elif parser.OBJECT_NAME: object_func = 'check_%s' % (parser.OBJECT_NAME) eval(object_func)() else: # TODO: print usage pass
def get_node_role(): node_roles = [] if NODE_ROLE.is_unknown(): return node_roles if NODE_ROLE.is_fuel(): node_roles.append('fuel') if NODE_ROLE.is_controller(): node_roles.append('controller') if NODE_ROLE.is_compute(): node_roles.append('compute') if NODE_ROLE.is_ceph_osd(): node_roles.append('ceph_osd') if NODE_ROLE.is_mongo(): node_roles.append('mongo') return node_roles
def env(parser): if NODE_ROLE.is_unknown(): LOG.error('Can not confirm the node role!') return if parser.CHECK_ALL: if not parser.OBJECT_NAME: check_all() else: check_nodes(parser.OBJECT_NAME) elif parser.OBJECT_NAME: object_func = 'check_%s' % (parser.OBJECT_NAME) eval(object_func)() else: # TODO: print usage pass