Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/api/server.py
Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | if cls == "pathslicing": | |||||||||
missing_keys.append(key) | missing_keys.append(key) | |||||||||
if missing_keys: | if missing_keys: | |||||||||
raise KeyError( | raise KeyError( | |||||||||
"Invalid configuration; missing %s config entry" | "Invalid configuration; missing %s config entry" | |||||||||
% (", ".join(missing_keys),) | % (", ".join(missing_keys),) | |||||||||
) | ) | |||||||||
elif cls == "noop": | ||||||||||
vlorentzUnsubmitted Not Done Inline Actions
vlorentz: | ||||||||||
raise EnvironmentError("Noop implementations should not be used in production.") | ||||||||||
return cfg | return cfg | |||||||||
def make_app_from_configfile(): | def make_app_from_configfile(): | |||||||||
"""Load configuration and then build application to run | """Load configuration and then build application to run | |||||||||
""" | """ | |||||||||
config_file = os.environ.get("SWH_CONFIG_FILENAME") | config_file = os.environ.get("SWH_CONFIG_FILENAME") | |||||||||
config = load_and_check_config(config_file) | config = load_and_check_config(config_file) | |||||||||
return make_app(config=config) | return make_app(config=config) | |||||||||
if __name__ == "__main__": | if __name__ == "__main__": | |||||||||
print("Deprecated. Use swh-objstorage") | print("Deprecated. Use swh-objstorage") |