コード例 #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)