removed excessive call to os.path.exists

os.path.isfile checks for existance anyway so
there is no point in checking both isfile and exists

Change-Id: Idbc2d22a807d5413db6e27ff0f6b5a87a5af8fa3
This commit is contained in:
Kirill 2015-03-03 01:03:28 +03:00
parent 99c46d64a0
commit 6e0b1f4d2b
1 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ def get_image_schema():
global IMAGE_SCHEMA
if IMAGE_SCHEMA is None:
schema_path = expanduser("~/.glanceclient/image_schema.json")
if os.path.exists(schema_path) and os.path.isfile(schema_path):
if os.path.isfile(schema_path):
with open(schema_path, "r") as f:
schema_raw = f.read()
IMAGE_SCHEMA = json.loads(schema_raw)
@ -356,7 +356,7 @@ def get_namespace_schema():
global NAMESPACE_SCHEMA
if NAMESPACE_SCHEMA is None:
schema_path = expanduser("~/.glanceclient/namespace_schema.json")
if os.path.exists(schema_path) and os.path.isfile(schema_path):
if os.path.isfile(schema_path):
with open(schema_path, "r") as f:
schema_raw = f.read()
NAMESPACE_SCHEMA = json.loads(schema_raw)
@ -495,7 +495,7 @@ def get_resource_type_schema():
global RESOURCE_TYPE_SCHEMA
if RESOURCE_TYPE_SCHEMA is None:
schema_path = expanduser("~/.glanceclient/resource_type_schema.json")
if os.path.exists(schema_path) and os.path.isfile(schema_path):
if os.path.isfile(schema_path):
with open(schema_path, "r") as f:
schema_raw = f.read()
RESOURCE_TYPE_SCHEMA = json.loads(schema_raw)