Remove useless counter fail_services in check_api script

The counter fail_services is useless. If an endpoint doesn't raise
exception, get_token() will return in the loop, or all the keystone
endpoints must be failed, no need to add fail_services.

Change-Id: I5fbc520af6b96816d5226fb9906170ef83b467c7
This commit is contained in:
YangShengMing 2016-03-12 04:01:45 +08:00
parent 2e67aed3e1
commit 37d46d30a0
1 changed files with 2 additions and 5 deletions

View File

@ -57,7 +57,6 @@ class OSAPI(object):
}
}
})
fail_services = 0
for keystone in self.endpoint_keystone:
self.logger.info("Trying to get token from '%s'" % keystone)
try:
@ -76,10 +75,8 @@ class OSAPI(object):
return
except Exception as e:
self.logger.debug("Got exception '%s'" % e)
fail_services += 1
if fail_services == len(self.endpoint_keystone):
self.logger.critical(0)
sys.exit(1)
self.logger.critical(0)
sys.exit(1)
def check_api(self, url, service):
self.logger.info("Trying '%s' on '%s'" % (service, url))