Skip to content

Commit

Permalink
[#4801] Use load_config from new CLI, support expanding user name
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Dec 20, 2019
1 parent fe2e6ea commit 4e015d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions ckan/cli/__init__.py
Expand Up @@ -22,10 +22,13 @@ def error_shout(exception):
)


def load_config(config=None):
def load_config(ini_path=None):
from paste.deploy import appconfig
if config:
filename = os.path.abspath(config)

if ini_path:
if ini_path.startswith('~'):
ini_path = os.path.expanduser(ini_path)
filename = os.path.abspath(ini_path)
config_source = u'-c parameter'
elif os.environ.get(u'CKAN_INI'):
filename = os.environ.get(u'CKAN_INI')
Expand Down
2 changes: 1 addition & 1 deletion ckan/tests/pytest_ckan/ckan_setup.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from ckan.lib.cli import load_config
from ckan.cli import load_config


def pytest_addoption(parser):
Expand Down

0 comments on commit 4e015d9

Please sign in to comment.