Replace file with open, which is Python 3 compatible
Change-Id: I471ae9b372f88a508d4654b1a18c6da90397a828
This commit is contained in:
@@ -431,7 +431,7 @@ class OpenStackImagesShell(object):
|
||||
force_auth=True)
|
||||
schema = client.schemas.get("image")
|
||||
|
||||
with file(schema_file_path, 'w') as f:
|
||||
with open(schema_file_path, 'w') as f:
|
||||
f.write(json.dumps(schema.raw()))
|
||||
except Exception as e:
|
||||
#NOTE(esheffield) do nothing here, we'll get a message later
|
||||
|
||||
@@ -29,7 +29,7 @@ def get_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):
|
||||
with file(schema_path, "r") as f:
|
||||
with open(schema_path, "r") as f:
|
||||
schema_raw = f.read()
|
||||
IMAGE_SCHEMA = json.loads(schema_raw)
|
||||
return IMAGE_SCHEMA
|
||||
|
||||
Reference in New Issue
Block a user