Fix tox -epep8 for Python3
This patch is fixing the hook-docker-cmd.py module to support running when Python3 is the default interpreter. Before this patch, the code was relying on the "unicode" built-in type which is not present in Python3. The six.text_type is being used instead. Change-Id: If44b1ea7497544abbbf16fa75c61e62bcd982328 Closes-Bug: #1643578
This commit is contained in:
parent
3d2faffe47
commit
c57e98d2cf
@ -19,6 +19,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
DOCKER_CMD = os.environ.get('HEAT_DOCKER_CMD', 'docker')
|
DOCKER_CMD = os.environ.get('HEAT_DOCKER_CMD', 'docker')
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ def main(argv=sys.argv):
|
|||||||
if key in ['environment', 'volumes', 'volumes_from']:
|
if key in ['environment', 'volumes', 'volumes_from']:
|
||||||
for value in config[container][key]:
|
for value in config[container][key]:
|
||||||
# Somehow the lists get empty values sometimes
|
# Somehow the lists get empty values sometimes
|
||||||
if type(value) is unicode and not value.strip():
|
if type(value) is six.text_type and not value.strip():
|
||||||
continue
|
continue
|
||||||
cmd.append(docker_arg_map(key, value))
|
cmd.append(docker_arg_map(key, value))
|
||||||
elif key == 'image':
|
elif key == 'image':
|
||||||
|
Loading…
Reference in New Issue
Block a user