]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: try to parse Keystone token in order appropriate to configuration.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 26 Feb 2016 14:25:20 +0000 (15:25 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 26 Feb 2016 16:41:27 +0000 (17:41 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_keystone.cc

index ba18d34965129b6d0bf690c87bba1e2b487b6ed5..5e9d63af28bf4b80dfe7852506ac2b85044265b8 100644 (file)
@@ -51,15 +51,15 @@ int KeystoneToken::parse(CephContext *cct, bufferlist& bl)
   try {
     const auto version = KeystoneService::get_api_version();
 
-    if (version == KeystoneApiVersion::VER_3) {
+    if (version == KeystoneApiVersion::VER_2) {
       if (!JSONDecoder::decode_json("access", *this, &parser)) {
         /* Token structure doesn't follow Identity API v2, so the token
          * must be in v3. Otherwise we can assume it's wrongly formatted. */
         JSONDecoder::decode_json("token", *this, &parser, true);
       }
-    } else if (version == KeystoneApiVersion::VER_2) {
+    } else if (version == KeystoneApiVersion::VER_3) {
       if (!JSONDecoder::decode_json("token", *this, &parser)) {
-        /* If the token cannot be parsed according to V2, try V3. */
+        /* If the token cannot be parsed according to V3, try V2. */
         JSONDecoder::decode_json("access", *this, &parser, true);
       }
     } else {