Skip to content

Commit

Permalink
Get config properly ckanext-arhiver -> ckanext.archiver
Browse files Browse the repository at this point in the history
  • Loading branch information
zelima committed Oct 10, 2019
1 parent 34a910e commit a8ca47f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ckanext/archiver/default_settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from pylons import config

# directory to save downloaded files to
ARCHIVE_DIR = config.get('ckanext-archiver.archive_dir', '/tmp/archive')
ARCHIVE_DIR = config.get('ckanext.archiver.archive_dir', '/tmp/archive')

# Max content-length of archived files, larger files will be ignored
MAX_CONTENT_LENGTH = int(config.get('ckanext-archiver.max_content_length',
MAX_CONTENT_LENGTH = int(config.get('ckanext.archiver.max_content_length',
50000000))

USER_AGENT_STRING = config.get('ckanext-archiver.user_agent_string', None)
USER_AGENT_STRING = config.get('ckanext.archiver.user_agent_string', None)
if not USER_AGENT_STRING:
USER_AGENT_STRING = '%s %s ckanext-archiver' % (
config.get('ckan.site_title', ''), config.get('ckan.site_url'))
8 changes: 3 additions & 5 deletions ckanext/archiver/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,11 @@ def download(context, resource, url_timeout=30,
if resource.get('url_type') == 'upload' and hosted_externally:
# ckanext-cloudstorage for example does that

# enable ckanext-archiver.archive_cloud for qa to work on cloud resources
# enable ckanext.archiver.archive_cloud for qa to work on cloud resources
# till https://github.com/ckan/ckanext-qa/issues/48 is resolved
# Warning: this will result in double storage of all files below archival filesize limit

if not config.get('ckanext-archiver.archive_cloud', False):
if not config.get('ckanext.archiver.archive_cloud', False):
raise ChooseNotToDownload('Skipping resource hosted externally to download resource: %s'
% url, url)

Expand Down Expand Up @@ -582,7 +582,7 @@ def get_plugins_waiting_on_ipipe():

def verify_https():
from pylons import config
return toolkit.asbool(config.get('ckanext-archiver.verify_https', True))
return toolkit.asbool(config.get('ckanext.archiver.verify_https', True))


def _clean_content_type(ct):
Expand Down Expand Up @@ -934,5 +934,3 @@ def link_checker(context, data):
(res.status_code, res.reason)
raise LinkHeadRequestError(error_message)
return json.dumps(dict(headers))


0 comments on commit a8ca47f

Please sign in to comment.