示例#1
0
文件: cluster.py 项目: naemono/pcs
def stop_cluster(argv):
    if len(argv) > 0:
        failure = False
        errors = ""
        for node in argv:
            (retval, err) = utils.stopCluster(node)
            if retval != 0:
                failure = True
                errors = errors + err+"\n"
        if failure:
            utils.err("unable to stop all nodes\n" + errors.rstrip())
        return

    print "Stopping Cluster..."
    output, retval = utils.run(["service", "pacemaker","stop"])
    if retval != 0:
        print output,
        utils.err("unable to stop pacemaker")
    if utils.is_rhel6():
        output, retval = utils.run(["service", "cman","stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop cman")
    else:
        output, retval = utils.run(["service", "corosync","stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop corosync")
示例#2
0
def stop_cluster(argv):
    if len(argv) > 0:
        failure = False
        errors = ""
        for node in argv:
            (retval, err) = utils.stopCluster(node)
            if retval != 0:
                failure = True
                errors = errors + err + "\n"
        if failure:
            utils.err("unable to stop all nodes\n" + errors.rstrip())
        return

    print "Stopping Cluster..."
    output, retval = utils.run(["service", "pacemaker", "stop"])
    if retval != 0:
        print output,
        utils.err("unable to stop pacemaker")
    if utils.is_rhel6():
        output, retval = utils.run(["service", "cman", "stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop cman")
    else:
        output, retval = utils.run(["service", "corosync", "stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop corosync")
示例#3
0
文件: cluster.py 项目: grueni/pcs
def stop_cluster(argv):
    if len(argv) > 0:
        for node in argv:
            utils.stopCluster(node)
            return

    print "Stopping Cluster...",
    output, retval = utils.run(["systemctl", "stop","pacemaker.service"])
    print output,
    if retval != 0:
        print "Error: unable to stop pacemaker"
        sys.exit(1)
    output, retval = utils.run(["systemctl", "stop","corosync.service"])
    print output,
    if retval != 0:
        print "Error: unable to stop corosync"
        sys.exit(1)
示例#4
0
def stop_cluster(argv):
    if len(argv) > 0:
        for node in argv:
            utils.stopCluster(node)
            return

    print "Stopping Cluster...",
    output, retval = utils.run(["systemctl", "stop", "pacemaker.service"])
    print output,
    if retval != 0:
        print "Error: unable to stop pacemaker"
        sys.exit(1)
    output, retval = utils.run(["systemctl", "stop", "corosync.service"])
    print output,
    if retval != 0:
        print "Error: unable to stop corosync"
        sys.exit(1)
示例#5
0
def stop_cluster(argv):
    if len(argv) > 0:
        for node in argv:
            utils.stopCluster(node)
            return

    print "Stopping Cluster..."
    output, retval = utils.run(["service", "pacemaker", "stop"])
    if retval != 0:
        print output,
        utils.err("unable to stop pacemaker")
    if utils.is_rhel6():
        output, retval = utils.run(["service", "cman", "stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop cman")
    else:
        output, retval = utils.run(["service", "corosync", "stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop corosync")
示例#6
0
文件: cluster.py 项目: adrianlzt/pcs
def stop_cluster(argv):
    if len(argv) > 0:
        for node in argv:
            utils.stopCluster(node)
            return

    print "Stopping Cluster..."
    output, retval = utils.run(["service", "pacemaker","stop"])
    if retval != 0:
        print output,
        utils.err("unable to stop pacemaker")
    if utils.is_rhel6():
        output, retval = utils.run(["service", "cman","stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop cman")
    else:
        output, retval = utils.run(["service", "corosync","stop"])
        if retval != 0:
            print output,
            utils.err("unable to stop corosync")
示例#7
0
文件: cluster.py 项目: lyon667/pcs
def stop_cluster_all():
    for node in utils.getNodesFromCorosyncConf():
        utils.stopCluster(node)
示例#8
0
 def run(self):
     utils.stopCluster(self.node)
示例#9
0
文件: cluster.py 项目: naemono/pcs
 def run(self):
     utils.stopCluster(self.node)
示例#10
0
def stop_cluster_all():
    for node in utils.getNodesFromCorosyncConf():
        utils.stopCluster(node)