Don't override _show_resource() for image
After refactored the method _show_resource() of resource.Resource, we can return the response directly if it's dict type. This patch removes _show_resource() in image.py. Change-Id: I95b5fd9d5dc5e6ab7fca79bed897920a5de40e7d
This commit is contained in:
parent
2fa8cc09d3
commit
4b25dd6777
|
@ -1907,7 +1907,7 @@ class Resource(object):
|
|||
try:
|
||||
obj = getattr(self.client(), self.entity)
|
||||
resource = obj.get(self.resource_id)
|
||||
if type(resource) == dict:
|
||||
if isinstance(resource, dict):
|
||||
return resource
|
||||
else:
|
||||
return resource.to_dict()
|
||||
|
|
|
@ -244,13 +244,6 @@ class GlanceImage(resource.Resource):
|
|||
else:
|
||||
images.update(self.resource_id, **prop_diff)
|
||||
|
||||
def _show_resource(self):
|
||||
if self.glance().version == 1.0:
|
||||
return super(GlanceImage, self)._show_resource()
|
||||
else:
|
||||
image = self.glance().images.get(self.resource_id)
|
||||
return dict(image)
|
||||
|
||||
def validate(self):
|
||||
super(GlanceImage, self).validate()
|
||||
container_format = self.properties[self.CONTAINER_FORMAT]
|
||||
|
|
Loading…
Reference in New Issue