- @staticmethod
- def _default_config():
- is_venv = os.getenv('VIRTUAL_ENV')
- return os.path.join('/' if not is_venv else is_venv,
- 'etc/opnfv_testapi/config.ini')
+ def _set_config_file(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-c", "--config-file", dest='config_file',
+ help="Config file location", metavar="FILE")
+ args, _ = parser.parse_known_args(sys.argv)
+ if hasattr(args, 'config_file') and args.config_file:
+ self.config_file = args.config_file
+
+
+CONF = Config()