From ef3e556b72378427be2d5abe28b6090e1b991b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Charlier?= Date: Mon, 11 Jun 2012 19:29:32 +0200 Subject: [PATCH] swift-bench should be able to use auth version 2.0 Fixes Bug #1011727 Change-Id: I6681bd85a5ddb82a1059913ae90696e5994aa906 --- AUTHORS | 1 + bin/swift-bench | 4 ++++ swift/common/bench.py | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index aadffb227e..5315e417cc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,6 +24,7 @@ Chmouel Boudjnah (chmouel@chmouel.com) Russell Bryant (rbryant@redhat.com) Devin Carlen (devin.carlen@gmail.com) Thierry Carrez (thierry@openstack.org) +François Charlier (francois.charlier@enovance.com) Julien Danjou (julien.danjou@enovance.com) Dan Dillinger (dan.dillinger@sonian.net) Tom Fifield (fifieldt@unimelb.edu.au) diff --git a/bin/swift-bench b/bin/swift-bench index e5b6bb4064..3a1e1fed5c 100755 --- a/bin/swift-bench +++ b/bin/swift-bench @@ -46,6 +46,7 @@ CONF_DEFAULTS = { 'devices': 'sdb1', 'log_level': 'INFO', 'timeout': '10', + 'auth_version': '1.0', } SAIO_DEFAULTS = { @@ -67,6 +68,7 @@ if __name__ == '__main__': num_objects = 1000 num_gets = 10000 delete = yes + auth_version = 1.0 """ parser = OptionParser(usage=usage) parser.add_option('', '--saio', dest='saio', action='store_true', @@ -89,6 +91,8 @@ if __name__ == '__main__': help='Number of GET operations to perform') parser.add_option('-x', '--no-delete', dest='delete', action='store_false', 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: parser.print_help() diff --git a/swift/common/bench.py b/swift/common/bench.py index 703881d02c..097b6fd54c 100644 --- a/swift/common/bench.py +++ b/swift/common/bench.py @@ -45,8 +45,11 @@ class Bench(object): self.key = conf.key self.auth_url = conf.auth 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: - 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.account = url.split('/')[-1] if conf.url == '':