def quiet_exec_cmd(self, cmd, exit_code=0): print "Quiet Executing command : %s" % cmd try: return mongoctl_main.do_main(cmd.split(" ")[1:]) except Exception, e: print ("WARNING: failed to quiet execute command '%s'. Cause: %s " % (cmd_display_str(cmd), e))
def quiet_exec_cmd(self, cmd, exit_code=0): print "Quiet Executing command : %s" % cmd try: return mongoctl_main.do_main(cmd.split(" ")[1:]) except Exception, e: print("WARNING: failed to quiet execute command '%s'. Cause: %s " % (cmd_display_str(cmd), e))
def exec_assert_cmd(self, cmd, exit_code=0): print "++++++++++ Testing command : %s" % cmd try: return mongoctl_main.do_main(cmd.split(" ")[1:]) except Exception, e: print("Error while executing test command '%s'. Cause: %s " % (cmd, e)) print "================= STACK TRACE ================" traceback.print_exc() print "Failing..." self.fail()
def exec_assert_cmd(self, cmd, exit_code=0): print "++++++++++ Testing command : %s" % cmd_display_str(cmd) try: # output = execute_command(cmd, shell=True, cwd=get_mongoctl_module_dir()) # print output return mongoctl_main.do_main(cmd) except Exception, e: print ("Error while executing test command '%s'. Cause: %s " % (cmd_display_str(cmd), e)) if isinstance(e, CalledProcessError): print "#### Command output ####" print e.output print "###################" print "================= STACK TRACE ================" traceback.print_exc() print "Failing..." self.fail()
def exec_assert_cmd(self, cmd, exit_code=0): print "++++++++++ Testing command : %s" % cmd_display_str(cmd) try: #output = execute_command(cmd, shell=True, cwd=get_mongoctl_module_dir()) #print output return mongoctl_main.do_main(cmd) except Exception, e: print("Error while executing test command '%s'. Cause: %s " % (cmd_display_str(cmd), e)) if isinstance(e, CalledProcessError): print "#### Command output ####" print e.output print "###################" print "================= STACK TRACE ================" traceback.print_exc() print "Failing..." self.fail()