X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=nfvbench%2Fnfvbench.py;h=891b2bb776b5eb007cc95dcd584dec39faa471f6;hb=1c9894ba0ccb31d64c5b2d15c700b98e332e0672;hp=598247a7a78591fdd1602ab06bb5adc25862bc7c;hpb=e4f42c701172b6b27dea2126e095e2526bcdb365;p=nfvbench.git diff --git a/nfvbench/nfvbench.py b/nfvbench/nfvbench.py index 598247a..891b2bb 100644 --- a/nfvbench/nfvbench.py +++ b/nfvbench/nfvbench.py @@ -60,8 +60,8 @@ class NFVBench(object): self.config_plugin = config_plugin self.factory = factory self.notifier = notifier - self.cred = credentials.Credentials(config.openrc_file, None, False) \ - if config.openrc_file else None + self.cred = credentials.Credentials(config.openrc_file, config.clouds_detail, None, False) \ + if config.openrc_file or config.clouds_detail else None self.chain_runner = None self.specs = Specs() self.specs.set_openstack_spec(openstack_spec) @@ -96,8 +96,10 @@ class NFVBench(object): # check that an empty openrc file (no OpenStack) is only allowed # with EXT chain - if not self.config.openrc_file and self.config.service_chain != ChainType.EXT: - raise Exception("openrc_file in the configuration is required for PVP/PVVP chains") + if (not self.config.openrc_file and not self.config.clouds_detail) and \ + self.config.service_chain != ChainType.EXT: + raise Exception("openrc_file or clouds_detail in the configuration is required" + " for PVP/PVVP chains") self.specs.set_run_spec(self.config_plugin.get_run_spec(self.config, self.specs.openstack)) @@ -719,7 +721,7 @@ def main(): sys.exit(0) if opts.summary: - with open(opts.summary) as json_data: + with open(opts.summary, encoding="utf-8") as json_data: result = json.load(json_data) if opts.user_label: result['config']['user_label'] = opts.user_label @@ -734,7 +736,8 @@ def main(): # dump the contents of the trex log file if opts.show_trex_log: try: - print(open('/tmp/trex.log').read(), end="") + with open('/tmp/trex.log', encoding="utf-8") as trex_log_file: + print(trex_log_file.read(), end="") except FileNotFoundError: print("No TRex log file found!") sys.exit(0)