Skip to content

Commit

Permalink
[storage,refactor][xs]: remove slightly weird method caching of ofs i…
Browse files Browse the repository at this point in the history
…mpl object on 'storage' package, relocating it to ofs property on controller where it is used.

* Main motivation was to avoid errors on startup (e.g. use of paster serve in development mode) of form::
  return GSConnection(gs_access_key_id, gs_secret_access_key, **kwargs)
  TypeError: __init__() got an unexpected keyword argument 'gs_bucket'
* (May still be a problem in the storage extension but at least we can start ckan!)
  • Loading branch information
rufuspollock committed Apr 25, 2011
1 parent 6f60f97 commit 405c0de
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ckanext/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def configure(self, config):
if not k.startswith('ofs.') or k == 'ofs.impl':
continue
kw[k[4:]] = v
from ckanext import storage
storage.ofs = get_impl(config.get('ofs.impl', 'google'))(**kw)

def before_map(self, route_map):
c = "ckanext.storage:StorageController"
Expand Down Expand Up @@ -53,8 +51,8 @@ def fix_stupid_pylons_encoding(data):
class StorageController(BaseController):
@property
def ofs(self):
from ckanext import storage
return storage.ofs
ofs = get_impl(config.get('ofs.impl', 'google'))(**kw)
return ofs

def set_metadata(self, bucket, label):
if not label.startswith("/"): label = "/" + label
Expand Down

0 comments on commit 405c0de

Please sign in to comment.