Commit 0e40cdc8 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[dock] Fix key search in dictionaries

parent 54522679
......@@ -151,7 +151,7 @@ class Host(object):
def _describe(image):
'''Tries to run the "describe" app on the image, collect results'''
if Host.images_cache.has_key(image):
if image in Host.images_cache:
return Host.images_cache[image]
cmd = [
......@@ -275,7 +275,7 @@ class Host(object):
key = description['name'] + ' (' + description['version'] + ')'
if description.has_key('databases'):
if 'databases' in description:
if (key in db_environments) and not _must_replace(image, db_environments, key):
continue
......@@ -327,6 +327,7 @@ class Host(object):
place.
"""
cmd = [
'docker',
'run',
......@@ -462,7 +463,7 @@ class Host(object):
data = client.stats(container.id, decode=True, stream=False)
# If CPU statistics can't be retrieved
if not data['cpu_stats'].has_key('system_cpu_usage'):
if 'system_cpu_usage' not in data['cpu_stats']:
data['cpu_stats'] = dict(data['precpu_stats'])
# If memory statistics can't be retrieved
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment