def run_command(self, command): cmd = NetTestCommand(self._command_context, command, self._resource_table, self._log_ctl) if self._command_context.get_cmd(cmd.get_id()) != None: prev_cmd = self._command_context.get_cmd(cmd.get_id()) if not prev_cmd.get_result_sent(): if cmd.get_id() is None: raise Exception("Previous foreground command still "\ "running!") else: raise Exception("Different command with id '%s' "\ "still running!" % cmd.get_id()) else: self._command_context.del_cmd(cmd) self._command_context.add_cmd(cmd) res = cmd.run() if not cmd.forked(): self._command_context.del_cmd(cmd) if command["type"] == "config": if res["passed"]: self._update_system_config(res["res_data"]["options"], command["persistent"]) else: err = "Error occured while setting system "\ "configuration (%s)" % res["res_data"]["err_msg"] logging.error(err) return res
def run_command(self, command): cmd = NetTestCommand(self._command_context, command, self._resource_table, self._log_ctl) self._command_context.add_cmd(cmd) res = cmd.run() if not cmd.forked(): self._command_context.del_cmd(cmd) if command["type"] == "system_config": if res["passed"]: self._update_system_config(res["res_data"]["options"], command["persistent"]) else: err = "Error occured while setting system "\ "configuration (%s)" % res["err_msg"] logging.error(err) return res
def run_command(self, command): cmd = NetTestCommand(self._command_context, command, self._resource_table, self._log_ctl) self._command_context.add_cmd(cmd) res = cmd.run() if not cmd.forked(): self._command_context.del_cmd(cmd) if command["type"] == "config": if res["passed"]: self._update_system_config(res["res_data"]["options"], command["persistent"]) else: err = "Error occured while setting system "\ "configuration (%s)" % res["res_data"]["err_msg"] logging.error(err) return res