()
| 120 | |
| 121 | |
| 122 | def extract_settings(): |
| 123 | settings['debug'] = options.debug |
| 124 | |
| 125 | if options.cookie_secret: |
| 126 | settings['cookie_secret'] = options.cookie_secret |
| 127 | |
| 128 | if options.url_prefix: |
| 129 | for name in ['login_url', 'static_url_prefix']: |
| 130 | settings[name] = prepend_url(settings[name], options.url_prefix) |
| 131 | |
| 132 | if options.auth: |
| 133 | settings['oauth'] = { |
| 134 | 'key': options.oauth2_key or os.environ.get('FLOWER_OAUTH2_KEY'), |
| 135 | 'secret': options.oauth2_secret or os.environ.get('FLOWER_OAUTH2_SECRET'), |
| 136 | 'redirect_uri': options.oauth2_redirect_uri or os.environ.get('FLOWER_OAUTH2_REDIRECT_URI'), |
| 137 | } |
| 138 | |
| 139 | if options.certfile and options.keyfile: |
| 140 | settings['ssl_options'] = dict(certfile=abs_path(options.certfile), |
| 141 | keyfile=abs_path(options.keyfile)) |
| 142 | if options.ca_certs: |
| 143 | settings['ssl_options']['ca_certs'] = abs_path(options.ca_certs) |
| 144 | |
| 145 | if options.auth and not validate_auth_option(options.auth): |
| 146 | logger.error("Invalid '--auth' option: %s", options.auth) |
| 147 | sys.exit(1) |
| 148 | |
| 149 | |
| 150 | def is_flower_option(arg): |
no test coverage detected