X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fcmd%2FNSBperf.py;h=011990a3d6b777efa42719f1606d21648e188e9c;hb=6444f136ec83856e7d9beabf765124d2a6d18466;hp=8f493dd0a7e0334ee8caf3be9e680913b8cd7494;hpb=2fa45d2f7e175cc5cbb57671dfc1c4afdd12a784;p=yardstick.git diff --git a/yardstick/cmd/NSBperf.py b/yardstick/cmd/NSBperf.py index 8f493dd0a..011990a3d 100755 --- a/yardstick/cmd/NSBperf.py +++ b/yardstick/cmd/NSBperf.py @@ -39,13 +39,11 @@ if not PYTHONPATH or not VIRTUAL_ENV: raise SystemExit(1) -def handler(): +def sigint_handler(*args, **kwargs): """ Capture ctrl+c and exit cli """ subprocess.call(["pkill", "-9", "yardstick"]) raise SystemExit(1) -signal.signal(signal.SIGINT, handler) - class YardstickNSCli(object): """ This class handles yardstick network serivce testing """ @@ -115,7 +113,7 @@ class YardstickNSCli(object): def generate_final_report(self, test_case): """ Function will check if partial test results are available and generates final report in rst format. -""" + """ report_caption = '{}\n{} ({})\n{}\n\n'.format( '================================================================', @@ -214,5 +212,6 @@ class YardstickNSCli(object): self.run_test(args, test_path) if __name__ == "__main__": + signal.signal(signal.SIGINT, sigint_handler) NS_CLI = YardstickNSCli() NS_CLI.main()