Skip to content

Commit dd7c3c9

Browse files
authored
Merge pull request #43 from stackhpc/merge-upstream-stein
Merge upstream stein
2 parents 8678e04 + 6f968da commit dd7c3c9

File tree

7 files changed

+57
-8
lines changed

7 files changed

+57
-8
lines changed

.zuul.d/base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
pre-run: tests/playbooks/pre.yml
4646
run: tests/playbooks/run.yml
4747
post-run: tests/playbooks/post.yml
48-
attempts: 1
48+
attempts: 5
4949
irrelevant-files:
5050
- ^.*\.rst$
5151
- ^doc/.*

docker/barbican/barbican-api/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
3535
'apache2',
3636
'barbican-api',
3737
'libapache2-mod-wsgi-py3',
38-
'uwsgi-plugin-python'
38+
'uwsgi-plugin-python3'
3939
] %}
4040

4141
{{ macros.install_packages(barbican_api_packages | customizable("packages")) }}

docker/base/opendaylight.repo

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[opendaylight]
2-
name=CentOS CBS OpenDaylight Release Repository
3-
# opendaylight package is not signed, so download from HTTPS source at least
4-
baseurl=https://cbs.centos.org/repos/nfv7-opendaylight-6-release/x86_64/os/
2+
name=OpenDaylight Carbon
3+
baseurl=https://nexus.opendaylight.org/content/repositories/opendaylight-carbon-epel-7-x86_64-devel/
54
enabled=1
65
gpgcheck=0

docker/prometheus/prometheus-openstack-exporter/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
44
{% block prometheus_openstack_exporter_header %}{% endblock %}
55

66
{% block prometheus_openstack_exporter_repository_version %}
7-
ENV prometheus_openstack_exporter_version=0.2.1
7+
ENV prometheus_openstack_exporter_version=0.6.0
88
{% endblock %}
99

1010
{% block prometheus_openstack_exporter_install %}

docker/qdrouterd/Dockerfile.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
1616
'qpid-dispatch-tools'
1717
] %}
1818

19+
# make sure qpid is pulled from centos-openstack-RELEASE (RDO) repo
20+
RUN yum-config-manager --disable epel centos-release-opstools extras
21+
1922
{{ macros.install_packages(qdrouterd_packages | customizable("packages")) }}
2023

2124
{% elif base_package_type == 'deb' %}

kolla/image/build.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ def run(self):
317317
self.success = True
318318

319319

320+
class PushError(Exception):
321+
"""Raised when there is a problem with pushing image to repository."""
322+
pass
323+
324+
320325
class PushTask(DockerTask):
321326
"""Task that pushes an image to a docker repository."""
322327

@@ -340,6 +345,9 @@ def run(self):
340345
' have the correct privileges to run Docker'
341346
' (root)')
342347
image.status = STATUS_CONNECTION_ERROR
348+
except PushError as exception:
349+
self.logger.error(exception)
350+
image.status = STATUS_PUSH_ERROR
343351
except Exception:
344352
self.logger.exception('Unknown error when pushing')
345353
image.status = STATUS_PUSH_ERROR
@@ -364,8 +372,7 @@ def push_image(self, image):
364372
if 'stream' in response:
365373
self.logger.info(response['stream'])
366374
elif 'errorDetail' in response:
367-
image.status = STATUS_ERROR
368-
self.logger.error(response['errorDetail']['message'])
375+
raise PushError(response['errorDetail']['message'])
369376

370377
# Reset any previous errors.
371378
image.status = STATUS_BUILT

kolla/tests/test_build.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def test_push_image(self, mock_client):
8383
@mock.patch.dict(os.environ, clear=True)
8484
@mock.patch('docker.APIClient')
8585
def test_push_image_failure(self, mock_client):
86+
"""failure on connecting Docker API"""
8687
self.dc = mock_client
8788
mock_client().push.side_effect = Exception
8889
pusher = build.PushTask(self.conf, self.image)
@@ -96,6 +97,7 @@ def test_push_image_failure(self, mock_client):
9697
@mock.patch.dict(os.environ, clear=True)
9798
@mock.patch('docker.APIClient')
9899
def test_push_image_failure_retry(self, mock_client):
100+
"""failure on connecting Docker API, success on retry"""
99101
self.dc = mock_client
100102
mock_client().push.side_effect = [Exception, []]
101103
pusher = build.PushTask(self.conf, self.image)
@@ -112,6 +114,44 @@ def test_push_image_failure_retry(self, mock_client):
112114
self.assertTrue(pusher.success)
113115
self.assertEqual(build.STATUS_BUILT, self.image.status)
114116

117+
@mock.patch('docker.version', '3.0.0')
118+
@mock.patch.dict(os.environ, clear=True)
119+
@mock.patch('docker.APIClient')
120+
def test_push_image_failure_error(self, mock_client):
121+
"""Docker connected, failure to push"""
122+
self.dc = mock_client
123+
mock_client().push.return_value = [{'errorDetail': {'message':
124+
'mock push fail'}}]
125+
pusher = build.PushTask(self.conf, self.image)
126+
pusher.run()
127+
mock_client().push.assert_called_once_with(
128+
self.image.canonical_name, decode=True, stream=True)
129+
self.assertFalse(pusher.success)
130+
self.assertEqual(build.STATUS_PUSH_ERROR, self.image.status)
131+
132+
@mock.patch('docker.version', '3.0.0')
133+
@mock.patch.dict(os.environ, clear=True)
134+
@mock.patch('docker.APIClient')
135+
def test_push_image_failure_error_retry(self, mock_client):
136+
"""Docker connected, failure to push, success on retry"""
137+
self.dc = mock_client
138+
mock_client().push.return_value = [{'errorDetail': {'message':
139+
'mock push fail'}}]
140+
pusher = build.PushTask(self.conf, self.image)
141+
pusher.run()
142+
mock_client().push.assert_called_once_with(
143+
self.image.canonical_name, decode=True, stream=True)
144+
self.assertFalse(pusher.success)
145+
self.assertEqual(build.STATUS_PUSH_ERROR, self.image.status)
146+
147+
# Try again, this time without exception.
148+
mock_client().push.return_value = [{'stream': 'mock push passes'}]
149+
pusher.reset()
150+
pusher.run()
151+
self.assertEqual(2, mock_client().push.call_count)
152+
self.assertTrue(pusher.success)
153+
self.assertEqual(build.STATUS_BUILT, self.image.status)
154+
115155
@mock.patch.dict(os.environ, clear=True)
116156
@mock.patch('docker.APIClient')
117157
def test_build_image(self, mock_client):

0 commit comments

Comments
 (0)