Example #1
0
 def do_restart(self, context, rsc):
     "usage: restart <rsc>"
     common_info("ordering %s to stop" % rsc)
     if not self._commit_meta_attr(context, rsc, "target-role", "Stopped"):
         return False
     if not utils.wait4dc("stop", not options.batch):
         return False
     common_info("ordering %s to start" % rsc)
     return self._commit_meta_attr(context, rsc, "target-role", "Started")
Example #2
0
 def do_restart(self, context, rsc):
     "usage: restart <rsc>"
     common_info("ordering %s to stop" % rsc)
     if not self._commit_meta_attr(context, rsc, "target-role", "Stopped"):
         return False
     if not utils.wait4dc("stop", not options.batch):
         return False
     common_info("ordering %s to start" % rsc)
     return self._commit_meta_attr(context, rsc, "target-role", "Started")
Example #3
0
 def do_latest(self, context):
     "usage: latest"
     if not utils.wait4dc("transition", not options.batch):
         return False
     self._set_source("live")
     crm_report.refresh_source()
     f = self._get_pe_byidx(-1)
     if not f:
         return False
     crm_report.show_transition_log(f)
Example #4
0
 def do_latest(self, context):
     "usage: latest"
     if not utils.wait4dc("transition", not options.batch):
         return False
     self._set_source("live")
     crm_report.refresh_source()
     f = self._get_pe_byidx(-1)
     if not f:
         return False
     crm_report.show_transition_log(f)
Example #5
0
 def do_restart(self, context, rsc):
     "usage: restart <rsc>"
     if not utils.is_name_sane(rsc):
         return False
     common_info("ordering %s to stop" % rsc)
     if not self.do_stop(context, rsc):
         return False
     if not utils.wait4dc("stop", not options.batch):
         return False
     common_info("ordering %s to start" % rsc)
     return self.do_start(context, rsc)
Example #6
0
    def execute_command(self):
        # build argument list
        arglist = [self.current_level(), self] + self.command_args
        # nskip = 2 to skip self and context when reporting errors
        ui_utils.validate_arguments(self.command_info.function, arglist, nskip=2)
        self.check_skill_level(self.command_info.skill_level)
        rv = self.command_info.function(*arglist)

        # should we wait till the command takes effect?
        if rv and self.should_wait():
            if not utils.wait4dc(self.command_name, not options.batch):
                return False
        return rv
Example #7
0
    def execute_command(self):
        # build argument list
        arglist = [self.current_level(), self] + self.command_args
        # nskip = 2 to skip self and context when reporting errors
        ui_utils.validate_arguments(self.command_info.function, arglist, nskip=2)
        self.check_skill_level(self.command_info.skill_level)
        rv = self.command_info.function(*arglist)

        # should we wait till the command takes effect?
        if rv and self.should_wait():
            if not utils.wait4dc(self.command_name, not options.batch):
                return False
        return rv