generateTokenFromCache is only valid for V3

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-04-26 20:51:05 +02:00
parent a1e379986b
commit 1dd7193047
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 2 additions and 2 deletions

View File

@ -131,9 +131,9 @@ class SwiftFactory {
$cachedToken = $this->params['cachedToken']; $cachedToken = $this->params['cachedToken'];
$hasValidCachedToken = false; $hasValidCachedToken = false;
if (is_array($cachedToken)) { if (\is_array($cachedToken) && ($authService instanceof IdentityV3Service)) {
$token = $authService->generateTokenFromCache($cachedToken); $token = $authService->generateTokenFromCache($cachedToken);
if (is_null($token->catalog)) { if (\is_null($token->catalog)) {
$this->logger->warning('Invalid cached token for swift, no catalog set: ' . json_encode($cachedToken)); $this->logger->warning('Invalid cached token for swift, no catalog set: ' . json_encode($cachedToken));
} else if ($token->hasExpired()) { } else if ($token->hasExpired()) {
$this->logger->debug('Cached token for swift expired'); $this->logger->debug('Cached token for swift expired');