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")
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")
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)
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)
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")
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")
def stop_cluster_all(): for node in utils.getNodesFromCorosyncConf(): utils.stopCluster(node)
def run(self): utils.stopCluster(self.node)