#213 Fix specifying a configuration file in the runserver
Merged 7 years ago by pingou. Opened 7 years ago by pingou.
pingou/fedora-hubs fix_runserver  into  develop

file modified
+10 -3
@@ -16,14 +16,21 @@ 

            localhost')

  parser.add_argument(

      '--config', '-c',

-     help='The configuration file to load from. Defaults to hubs.default_config. \

-           Write the config file name in object form. For example: hubs.my_config')

+     help='A configuration file to load (allowing to override the default '

+     'configuraton)')

  

  

  args = parser.parse_args()

  

+ if args.config:

+     config = args.config

+     if not config.startswith('/'):

+         here = os.path.join(os.path.dirname(os.path.abspath(__file__)))

+         config = os.path.join(here, config)

+     os.environ['HUBS_CONFIG'] = config

+ 

+ 

  from hubs.app import app

  

  app.debug = True

- app.config.from_object(args.config)

  app.run(debug=True, host=args.host, port=int(args.port))

no initial comment

rebased

7 years ago

I'm going to wait for @atelic to confirm that this works before merging, thanks for the review :)

Confirmed that it works for me. :thumbsup:

You will want to change the help text since that format won't work anymore

1 new commit added

  • Adjust the help message for the config CLI argument
7 years ago

alloing

Allowing? :)

1 new commit added

  • Typi, typo
7 years ago

Pull-Request has been merged by pingou

7 years ago
Metadata