Skip to content

Commit

Permalink
Merge pull request #4750 from ckan/4748-remove-ofs
Browse files Browse the repository at this point in the history
[#4748] Remove ofs and pairtree
  • Loading branch information
David Read committed Apr 27, 2019
2 parents 35fc513 + 30e197f commit 3b2cbdb
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 56 deletions.
1 change: 0 additions & 1 deletion ckan/lib/app_globals.py
Expand Up @@ -47,7 +47,6 @@
'ckan.template_footer_end': {},
'ckan.dumps_url': {},
'ckan.dumps_format': {},
'ofs.impl': {'name': 'ofs_impl'},
'ckan.homepage_style': {'default': '1'},

# split string
Expand Down
12 changes: 0 additions & 12 deletions ckan/lib/uploader.py
Expand Up @@ -79,20 +79,8 @@ def get_storage_path():
# None means it has not been set. False means not in config.
if _storage_path is None:
storage_path = config.get('ckan.storage_path')
ofs_impl = config.get('ofs.impl')
ofs_storage_dir = config.get('ofs.storage_dir')
if storage_path:
_storage_path = storage_path
elif ofs_impl == 'pairtree' and ofs_storage_dir:
log.warn('''Please use config option ckan.storage_path instead of
ofs.storage_dir''')
_storage_path = ofs_storage_dir
return _storage_path
elif ofs_impl:
log.critical('''We only support local file storage form version 2.2
of ckan please specify ckan.storage_path in your
config for your uploads''')
_storage_path = False
else:
log.critical('''Please specify a ckan.storage_path in your config
for your uploads''')
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates-bs2/package/new_resource_not_draft.html
Expand Up @@ -9,7 +9,7 @@
{% endblock %}

{% block form %}
{% snippet resource_form_snippet, data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, allow_upload=g.ofs_impl and logged_in, dataset_type=dataset_type %}
{% snippet resource_form_snippet, data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, dataset_type=dataset_type %}
{% endblock %}

{% block content_primary_nav %}
Expand Down
1 change: 0 additions & 1 deletion ckan/templates-bs2/package/resource_edit.html
Expand Up @@ -9,7 +9,6 @@
error_summary=error_summary,
pkg_name=pkg.name,
form_action=form_action,
allow_upload=g.ofs_impl and logged_in,
resource_form_snippet=resource_form_snippet,
dataset_type=dataset_type %}
{% endblock %}
2 changes: 1 addition & 1 deletion ckan/templates/package/new_resource.html
Expand Up @@ -12,7 +12,7 @@
{% endif %}
{% endblock %}

{% block form %}{% snippet resource_form_snippet, data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, allow_upload=g.ofs_impl and logged_in, dataset_type=dataset_type %}{% endblock %}
{% block form %}{% snippet resource_form_snippet, data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, dataset_type=dataset_type %}{% endblock %}

{% block secondary_content %}
{% snippet 'package/snippets/resource_help.html' %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/new_resource_not_draft.html
Expand Up @@ -9,7 +9,7 @@
{% endblock %}

{% block form %}
{% snippet resource_form_snippet, data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, allow_upload=g.ofs_impl and logged_in, dataset_type=dataset_type %}
{% snippet resource_form_snippet, data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, dataset_type=dataset_type %}
{% endblock %}

{% block content_primary_nav %}
Expand Down
1 change: 0 additions & 1 deletion ckan/templates/package/resource_edit.html
Expand Up @@ -9,7 +9,6 @@
error_summary=error_summary,
pkg_name=pkg.name,
form_action=form_action,
allow_upload=g.ofs_impl and logged_in,
resource_form_snippet=resource_form_snippet,
dataset_type=dataset_type %}
{% endblock %}
33 changes: 0 additions & 33 deletions doc/maintaining/configuration.rst
Expand Up @@ -1490,39 +1490,6 @@ Default value: ``2``

The maximum in megabytes an image upload can be.

.. _ofs.impl:

ofs.impl
^^^^^^^^

Example::

ofs.impl = pairtree

Default value: ``None``

Defines the storage backend used by CKAN: ``pairtree`` for local storage, ``s3`` for Amazon S3 Cloud Storage or ``google`` for Google Cloud Storage. Note that each of these must be accompanied by the relevant settings for each backend described below.

Deprecated, only available option is now pairtree. This must be used nonetheless if upgrading for CKAN 2.1 in order to keep access to your old pairtree files.


.. _ofs.storage_dir:

ofs.storage_dir
^^^^^^^^^^^^^^^

Example::

ofs.storage_dir = /data/uploads/

Default value: ``None``

Only used with the local storage backend. Use this to specify where uploaded files should be stored, and also to turn on the handling of file storage. The folder should exist, and will automatically be turned into a valid pairtree repository if it is not already.

Deprecated, please use ckan.storage_path. This must be used nonetheless if upgrading for CKAN 2.1 in order to keep access to your old pairtree files.




DataPusher Settings
-------------------
Expand Down
2 changes: 0 additions & 2 deletions requirements.in
Expand Up @@ -8,8 +8,6 @@ Flask==0.12.4
Flask-Babel==0.11.2
Jinja2==2.10.1
Markdown==2.6.7
ofs==0.4.2
Pairtree==0.7.1-T
passlib==1.6.5
paste==1.7.5.1
polib==1.0.7
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Expand Up @@ -4,7 +4,6 @@
#
# pip-compile --output-file requirements.txt requirements.in
#
argparse==1.4.0 # via ofs
babel==2.3.4
beaker==1.10.0 # via pylons
bleach==3.0.2
Expand All @@ -24,8 +23,6 @@ mako==1.0.7 # via pylons
markdown==2.6.7
markupsafe==1.0 # via jinja2, mako, webhelpers
nose==1.3.7 # via pylons
ofs==0.4.2
pairtree==0.7.1-t
passlib==1.6.5
paste==1.7.5.1
pastedeploy==1.5.2 # via pastescript, pylons
Expand Down

0 comments on commit 3b2cbdb

Please sign in to comment.