From c0522e2419a982f52bd5155461b1a7315986a2f1 Mon Sep 17 00:00:00 2001 From: hwang Date: Thu, 29 Aug 2024 13:39:10 -0700 Subject: [PATCH] Fix the CI gate failure The root cause is getting a error ip address for Zaqar service. Change-Id: I879a4e0115e583b9752301a9d8167f77a70ca187 --- zaqarclient/tests/queues/base.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/zaqarclient/tests/queues/base.py b/zaqarclient/tests/queues/base.py index 08a0d9f4..dc654398 100644 --- a/zaqarclient/tests/queues/base.py +++ b/zaqarclient/tests/queues/base.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import subprocess from unittest import mock from oslo_utils import netutils @@ -21,14 +22,18 @@ from zaqarclient.queues import client from zaqarclient.tests import base from zaqarclient.tests.transport import dummy - -MY_IP = netutils.get_my_ipv4() +cmd = 'cat /etc/zaqar/uwsgi.conf | grep http' +MY_HOST_IP = subprocess.run(cmd, shell=True, capture_output=True, text=True) +if len(MY_HOST_IP.stdout.split("= ")) < 2: + MY_IP = netutils.get_my_ipv4() + ':8888' +else: + MY_IP = MY_HOST_IP.stdout.split("= ")[1] class QueuesTestBase(base.TestBase): transport_cls = dummy.DummyTransport - url = 'http://%s:8888' % MY_IP + url = 'http://%s' % MY_IP version = 1 def setUp(self):