Skip to content

Commit

Permalink
issue #8: fixed env var config setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Danstrom committed Sep 6, 2017
1 parent 50a37a5 commit 412f5fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions metadatastorageapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
from .blueprint import BLUEPRINT

class Configuration(metaclass=MetaFlaskEnv):
ENV_PREFIX='METADATA_STORAGE_API'
ENV_PREFIX='METADATA_STORAGE_API_'
DEBUG = False
DEFER_CONFIG = False

APP = Flask(__name__)
APP.config.from_object(Configuration)
print(APP.config["METADATA_STORAGE_API_STORAGE_TYPE"])
APP.register_blueprint(BLUEPRINT)
5 changes: 2 additions & 3 deletions metadatastorageapi/blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@

def _get_storage_system():
from flask import current_app
print(current_app.config)
return StorageSystemFactory(current_app.config.get("METADATA_STORAGE_API_STORAGE_TYPE").lower(),
location=current_app.config.get("METADATA_STORAGE_API_STORAGE_LOCATION").build())
return StorageSystemFactory(current_app.config.get("STORAGE_TYPE").lower(),
location=current_app.config.get("STORAGE_LOCATION")).build()

def _common_response_body_building(rtype="aggregate"):
root = ElementTree.Element("{http://lib.uchicago.edu/ldr}output")
Expand Down

0 comments on commit 412f5fc

Please sign in to comment.