Exemple #1
0
 def do_stop(self, context):
     '''
     Stops the cluster services on this node
     '''
     rc, out, err = utils.get_stdout_stderr('service pacemaker stop')
     if rc != 0:
         context.fatal_error("Failed to stop pacemaker service: %s" % (err))
     rc, out, err = utils.get_stdout_stderr('service corosync stop')
     if rc != 0:
         context.fatal_error("Failed to stop corosync service: %s" % (err))
     err_buf.info("Cluster services stopped")
Exemple #2
0
 def do_stop(self, context):
     '''
     Stops the cluster services on this node
     '''
     rc, out, err = utils.get_stdout_stderr('service pacemaker stop')
     if rc != 0:
         context.fatal_error("Failed to stop pacemaker service: %s" % (err))
     rc, out, err = utils.get_stdout_stderr('service corosync stop')
     if rc != 0:
         context.fatal_error("Failed to stop corosync service: %s" % (err))
     err_buf.info("Cluster services stopped")
Exemple #3
0
def verify(cib):
    rc, _, stderr = utils.get_stdout_stderr(cib_verify, cib)
    for i, line in enumerate(line for line in stderr.split('\n') if line):
        if i == 0:
            err_buf.error(_prettify(line, 0))
        else:
            err_buf.writemsg(_prettify(line, 7))
    return rc
Exemple #4
0
def verify(cib):
    rc, _, stderr = utils.get_stdout_stderr(cib_verify, cib)
    for i, line in enumerate(line for line in stderr.split('\n') if line):
        if i == 0:
            err_buf.error(_prettify(line, 0))
        else:
            err_buf.writemsg(_prettify(line, 7))
    return rc
Exemple #5
0
 def _process_local(self, cmdline):
     """
     Handle a step that executes locally
     """
     if self.sudo_pass:
         input_s = u'sudo: %s\n' % (self.sudo_pass)
     else:
         input_s = None
     rc, out, err = utils.get_stdout_stderr(cmdline, input_s=input_s, shell=True)
     if rc != 0:
         self.error("[%s]: Error (%d): %s", self.local_node[0], rc, err)
         return None
     self.debug("%s" % repr(out))
     return out
Exemple #6
0
 def _process_local(self, cmdline):
     """
     Handle a step that executes locally
     """
     if self.sudo_pass:
         input_s = u'sudo: %s\n' % (self.sudo_pass)
     else:
         input_s = None
     rc, out, err = utils.get_stdout_stderr(cmdline,
                                            input_s=input_s,
                                            shell=True)
     if rc != 0:
         self.error("[%s]: Error (%d): %s", self.local_node[0], rc, err)
         return None
     self.debug("%s" % repr(out))
     return out