MCPcopy
hub / github.com/mher/flower / extract_settings

Function extract_settings

flower/command.py:122–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120
121
122def 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
150def is_flower_option(arg):

Callers 1

flowerFunction · 0.85

Calls 4

prepend_urlFunction · 0.85
abs_pathFunction · 0.85
validate_auth_optionFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected