示例#1
0
def up(*args, **cmdoptions):
    l = len(utl.topic_stack)
    if l > 1:
	utl.topic_stack.pop()
	utl.set_topic(utl.topic_stack[-1])
    else:
	utl.log_debug("Already at the top of the stack")
示例#2
0
def do_list(*args, **cmdoptions):
    topic = utl.crm_topic
    if cmdoptions.has_key("topic") and cmdoptions["topic"]:
	topic = cmdoptions["topic"]

    utl.log_debug("Complete '%s' listing" % topic)
    if topic == "resources":
	utl.os_system("crm_resource -l", True)
    elif topic == "nodes":
	lines = utl.os_system("cibadmin -Q -o nodes", False)
	for line in lines:
	    if line.find("node ") >= 0:
		print line.rstrip()
    else:
	utl.log_err("%s: Topic %s is not (yet) supported" % ("list", topic))
	return 1
    return 0