Merge "Fix python3 compatibility in kolla_docker"

This commit is contained in:
Jenkins 2017-01-05 10:07:44 +00:00 committed by Gerrit Code Review
commit 3b2fcf7674
2 changed files with 10 additions and 10 deletions

View File

@ -434,7 +434,7 @@ class DockerWorker(object):
image, tag = self.parse_image() image, tag = self.parse_image()
statuses = [ statuses = [
json.loads(line.strip()) for line in self.dc.pull( json.loads(line.strip().decode('utf-8')) for line in self.dc.pull(
repository=image, tag=tag, stream=True repository=image, tag=tag, stream=True
) )
] ]

View File

@ -464,9 +464,9 @@ class TestImage(base.BaseTestCase):
'auth_email': 'fake_mail@foogle.com' 'auth_email': 'fake_mail@foogle.com'
}) })
self.dw.dc.pull.return_value = [ self.dw.dc.pull.return_value = [
'{"status":"Pull complete","progressDetail":{},"id":"22f7"}\r\n', b'{"status":"Pull complete","progressDetail":{},"id":"22f7"}\r\n',
'{"status":"Digest: sha256:47c3bdbcf99f0c1a36e4db"}\r\n', b'{"status":"Digest: sha256:47c3bdbcf99f0c1a36e4db"}\r\n',
'{"status":"Downloaded newer image for ubuntu:16.04"}\r\n' b'{"status":"Downloaded newer image for ubuntu:16.04"}\r\n'
] ]
self.dw.pull_image() self.dw.pull_image()
@ -480,9 +480,9 @@ class TestImage(base.BaseTestCase):
self.dw = get_DockerWorker( self.dw = get_DockerWorker(
{'image': 'myregistrydomain.com:5000/ubuntu:16.04'}) {'image': 'myregistrydomain.com:5000/ubuntu:16.04'})
self.dw.dc.pull.return_value = [ self.dw.dc.pull.return_value = [
'{"status":"Pull complete","progressDetail":{},"id":"22f7"}\r\n', b'{"status":"Pull complete","progressDetail":{},"id":"22f7"}\r\n',
'{"status":"Digest: sha256:47c3bdbf0c1a36e4db"}\r\n', b'{"status":"Digest: sha256:47c3bdbf0c1a36e4db"}\r\n',
'{"status":"mage is up to date for ubuntu:16.04"}\r\n' b'{"status":"mage is up to date for ubuntu:16.04"}\r\n'
] ]
self.dw.pull_image() self.dw.pull_image()
@ -496,7 +496,7 @@ class TestImage(base.BaseTestCase):
self.dw = get_DockerWorker( self.dw = get_DockerWorker(
{'image': 'myregistrydomain.com:5000/ubuntu:16.04'}) {'image': 'myregistrydomain.com:5000/ubuntu:16.04'})
self.dw.dc.pull.return_value = [ self.dw.dc.pull.return_value = [
'{"status": "some random message"}\r\n'] b'{"status": "some random message"}\r\n']
self.dw.pull_image() self.dw.pull_image()
self.dw.dc.pull.assert_called_once_with( self.dw.dc.pull.assert_called_once_with(
@ -512,7 +512,7 @@ class TestImage(base.BaseTestCase):
self.dw = get_DockerWorker( self.dw = get_DockerWorker(
{'image': 'unknown:16.04'}) {'image': 'unknown:16.04'})
self.dw.dc.pull.return_value = [ self.dw.dc.pull.return_value = [
'{"error": "image unknown not found"}\r\n'] b'{"error": "image unknown not found"}\r\n']
self.dw.pull_image() self.dw.pull_image()
self.dw.dc.pull.assert_called_once_with( self.dw.dc.pull.assert_called_once_with(
@ -528,7 +528,7 @@ class TestImage(base.BaseTestCase):
self.dw = get_DockerWorker( self.dw = get_DockerWorker(
{'image': 'myregistrydomain.com:5000/ubuntu:16.04'}) {'image': 'myregistrydomain.com:5000/ubuntu:16.04'})
self.dw.dc.pull.return_value = [ self.dw.dc.pull.return_value = [
'{"error": "unexpected error"}\r\n'] b'{"error": "unexpected error"}\r\n']
self.dw.pull_image() self.dw.pull_image()
self.dw.dc.pull.assert_called_once_with( self.dw.dc.pull.assert_called_once_with(