Merge "swift-bench should be able to use auth version 2.0"

This commit is contained in:
Jenkins 2012-07-02 18:49:13 +00:00 committed by Gerrit Code Review
commit 217676c06c
3 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,7 @@ Chmouel Boudjnah (chmouel@chmouel.com)
Russell Bryant (rbryant@redhat.com) Russell Bryant (rbryant@redhat.com)
Devin Carlen (devin.carlen@gmail.com) Devin Carlen (devin.carlen@gmail.com)
Thierry Carrez (thierry@openstack.org) Thierry Carrez (thierry@openstack.org)
François Charlier (francois.charlier@enovance.com)
Julien Danjou (julien.danjou@enovance.com) Julien Danjou (julien.danjou@enovance.com)
Dan Dillinger (dan.dillinger@sonian.net) Dan Dillinger (dan.dillinger@sonian.net)
Tom Fifield (fifieldt@unimelb.edu.au) Tom Fifield (fifieldt@unimelb.edu.au)

View File

@ -46,6 +46,7 @@ CONF_DEFAULTS = {
'devices': 'sdb1', 'devices': 'sdb1',
'log_level': 'INFO', 'log_level': 'INFO',
'timeout': '10', 'timeout': '10',
'auth_version': '1.0',
} }
SAIO_DEFAULTS = { SAIO_DEFAULTS = {
@ -67,6 +68,7 @@ if __name__ == '__main__':
num_objects = 1000 num_objects = 1000
num_gets = 10000 num_gets = 10000
delete = yes delete = yes
auth_version = 1.0
""" """
parser = OptionParser(usage=usage) parser = OptionParser(usage=usage)
parser.add_option('', '--saio', dest='saio', action='store_true', parser.add_option('', '--saio', dest='saio', action='store_true',
@ -89,6 +91,8 @@ if __name__ == '__main__':
help='Number of GET operations to perform') help='Number of GET operations to perform')
parser.add_option('-x', '--no-delete', dest='delete', action='store_false', parser.add_option('-x', '--no-delete', dest='delete', action='store_false',
help='If set, will not delete the objects created') help='If set, will not delete the objects created')
parser.add_option('-V', '--auth_version', dest='auth_version',
help='Authentication version')
if len(sys.argv) == 1: if len(sys.argv) == 1:
parser.print_help() parser.print_help()

View File

@ -45,8 +45,11 @@ class Bench(object):
self.key = conf.key self.key = conf.key
self.auth_url = conf.auth self.auth_url = conf.auth
self.use_proxy = conf.use_proxy.lower() in TRUE_VALUES self.use_proxy = conf.use_proxy.lower() in TRUE_VALUES
self.auth_version = conf.auth_version
self.logger.info("Auth version: %s" % self.auth_version)
if self.use_proxy: if self.use_proxy:
url, token = client.get_auth(self.auth_url, self.user, self.key) url, token = client.get_auth(self.auth_url, self.user, self.key,
auth_version=self.auth_version)
self.token = token self.token = token
self.account = url.split('/')[-1] self.account = url.split('/')[-1]
if conf.url == '': if conf.url == '':