In kamaki.clients.pithos context, the variable is still called account
Only the callers change their behavior, as they should retrive the
account by calling kamaki.clients.astakos.AstakosClient().term('uuid')
Tests are also adjusted
from kamaki.cli.argument import ProgressBarArgument
from kamaki.cli.commands import _command_init, errors
from kamaki.clients.pithos import PithosClient, ClientError
from kamaki.cli.argument import ProgressBarArgument
from kamaki.cli.commands import _command_init, errors
from kamaki.clients.pithos import PithosClient, ClientError
+from kamaki.clients.astakos import AstakosClient
kloger = getLogger('kamaki')
kloger = getLogger('kamaki')
' to get the service url: /config get store.url',
' to set the service url: /config set store.url <url>',
' ',
' to get the service url: /config get store.url',
' to set the service url: /config set store.url <url>',
' ',
- ' to get user the account: /config get store.account',
+ ' to get user account: /config get store.account',
' or /config get account',
' to set the user account: /config set store.account <account>',
' ',
' or /config get account',
' to set the user account: /config set store.account <account>',
' ',
or self.config.get('global', 'token')
self.base_url = self.config.get('store', 'url')\
or self.config.get('global', 'url')
or self.config.get('global', 'token')
self.base_url = self.config.get('store', 'url')\
or self.config.get('global', 'url')
- self.account = self.config.get('store', 'account')\
- or self.config.get('global', 'account')
self.container = self.config.get('store', 'container')\
or self.config.get('global', 'container')
self.client = PithosClient(base_url=self.base_url,
self.container = self.config.get('store', 'container')\
or self.config.get('global', 'container')
self.client = PithosClient(base_url=self.base_url,
def main(self):
self._run()
def main(self):
self._run()
+ def _set_account(self):
+ astakos = AstakosClient(self.config.get('astakos', 'url'), self.token)
+ self.account = astakos.term('uuid')
+
class _store_account_command(_pithos_init):
"""Base class for account level storage commands"""
class _store_account_command(_pithos_init):
"""Base class for account level storage commands"""
from kamaki.clients import tests, ClientError
from kamaki.clients.pithos import PithosClient
from kamaki.clients import tests, ClientError
from kamaki.clients.pithos import PithosClient
+from kamaki.clients.astakos import AstakosClient
class Pithos(tests.Generic):
class Pithos(tests.Generic):
self.client = PithosClient(
self['store', 'url'],
self['store', 'token'],
self.client = PithosClient(
self['store', 'url'],
self['store', 'token'],
- self['store', 'account'])
+ AstakosClient(
+ self['astakos', 'url'],
+ self['store', 'token']
+ ).term('uuid'))
self.now = time.mktime(time.gmtime())
self.now_unformated = datetime.datetime.utcnow()
self.now = time.mktime(time.gmtime())
self.now_unformated = datetime.datetime.utcnow()
self.client.container = self.c1
self.client.object_post('test',
update=True,
self.client.container = self.c1
self.client.object_post('test',
update=True,
- permissions={'read': 'someUser'})
+ permissions={'read': [self.client.account]})
self.create_remote_object(self.c1, 'another.test')
self.create_remote_object(self.c1, 'another.test')