From a8ca47fa158201002bcf3c7624ca283bb3c28251 Mon Sep 17 00:00:00 2001 From: Irakli Mchedlishvili Date: Thu, 10 Oct 2019 08:26:50 +0400 Subject: [PATCH] Get config properly ckanext-arhiver -> ckanext.archiver --- ckanext/archiver/default_settings.py | 6 +++--- ckanext/archiver/tasks.py | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ckanext/archiver/default_settings.py b/ckanext/archiver/default_settings.py index 2e9cf0a6..d972aedf 100644 --- a/ckanext/archiver/default_settings.py +++ b/ckanext/archiver/default_settings.py @@ -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')) diff --git a/ckanext/archiver/tasks.py b/ckanext/archiver/tasks.py index 8aefeab7..332a425e 100644 --- a/ckanext/archiver/tasks.py +++ b/ckanext/archiver/tasks.py @@ -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) @@ -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): @@ -934,5 +934,3 @@ def link_checker(context, data): (res.status_code, res.reason) raise LinkHeadRequestError(error_message) return json.dumps(dict(headers)) - -