def do_exit(self, arg): """Quits the application""" print termstyle.cyan('Bye Bye!') return True
"*** End of scenario (T-Rex is not running now) ***") elif ret is None: print termstyle.magenta( "*** End of scenario (T-Rex termination aborted) ***") else: print termstyle.red( "*** End of scenario (T-Rex termination failed) ***") def do_exit(self, arg): """Quits the application""" print termstyle.cyan('Bye Bye!') return True if __name__ == "__main__": parser = ArgumentParser(description=termstyle.cyan( 'Run T-Rex client API demos and scenarios.'), usage="""client_interactive_example [options]""") parser.add_argument('-v', '--version', action='version', version='%(prog)s 1.0 \t (C) Cisco Systems Inc.\n') parser.add_argument( "-t", "--trex-host", required=True, dest="trex_host", action="store", help="Specify the hostname or ip to connect with T-Rex server.", metavar="HOST")
ret = self.trex.force_kill() if ret: print termstyle.green("*** End of scenario (T-Rex is not running now) ***") elif ret is None: print termstyle.magenta("*** End of scenario (T-Rex termination aborted) ***") else: print termstyle.red("*** End of scenario (T-Rex termination failed) ***") def do_exit(self, arg): """Quits the application""" print termstyle.cyan('Bye Bye!') return True if __name__ == "__main__": parser = ArgumentParser(description = termstyle.cyan('Run T-Rex client API demos and scenarios.'), usage = """client_interactive_example [options]""" ) parser.add_argument('-v', '--version', action='version', version='%(prog)s 1.0 \t (C) Cisco Systems Inc.\n') parser.add_argument("-t", "--trex-host", required = True, dest="trex_host", action="store", help="Specify the hostname or ip to connect with T-Rex server.", metavar="HOST" ) parser.add_argument("-p", "--trex-port", type=int, default = 8090, metavar="PORT", dest="trex_port", help="Select port on which the T-Rex server listens. Default port is 8090.", action="store") parser.add_argument("-m", "--maxhist", type=int, default = 100, metavar="SIZE", dest="hist_size", help="Specify maximum history size saved at client side. Default size is 100.", action="store") parser.add_argument("--verbose", dest="verbose", action="store_true", help="Switch ON verbose option at T-Rex client. Default is: OFF.", default = False ) args = parser.parse_args()