diff --git a/.zuul.yaml b/.zuul.yaml index 44947e943..663c8ee32 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -129,6 +129,7 @@ - job: name: monasca-tempest-python3-influxdb parent: monasca-tempest-base + voting: false vars: devstack_localrc: MONASCA_API_IMPLEMENTATION_LANG: python @@ -206,21 +207,12 @@ - monasca-tempest-log-python3-influxdb - monasca-tempest-python3-influxdb - monasca-tempest-python3-cassandra - - build-monasca-docker-image + - build-monasca-docker-image: + voting: false gate: queue: monasca jobs: - monasca-tempest-log-python3-influxdb - - monasca-tempest-python3-influxdb - post: - jobs: - - publish-monasca-api-docker-image - periodic: - jobs: - - publish-monasca-api-docker-image - release: - jobs: - - publish-monasca-api-docker-image - job: name: publish-monasca-api-docker-image diff --git a/lower-constraints.txt b/lower-constraints.txt index 6a3acc6cc..f66f0a94c 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -97,6 +97,7 @@ requestsexceptions==1.2.0 requests-mock==1.2.0 restructuredtext-lint==1.1.1 rfc3986==0.3.1 +simplejson==3.8.1 six==1.10.0 smmap==0.9.0 snowballstemmer==1.2.1 @@ -115,7 +116,6 @@ testrepository==0.0.18 testscenarios==0.4 testtools==2.2.0 traceback2==1.4.0 -ujson==1.35 unittest2==1.1.0 urllib3==1.21.1 voluptuous==0.8.9 diff --git a/monasca_api/api/core/log/log_publisher.py b/monasca_api/api/core/log/log_publisher.py index 01886fe20..85495d7b6 100644 --- a/monasca_api/api/core/log/log_publisher.py +++ b/monasca_api/api/core/log/log_publisher.py @@ -16,8 +16,8 @@ import time import falcon +from monasca_api.common.rest import utils as rest_utils from monasca_common.kafka import client_factory -from monasca_common.rest import utils as rest_utils from oslo_log import log from oslo_utils import encodeutils diff --git a/monasca_api/api/core/log/model.py b/monasca_api/api/core/log/model.py index 4a24739e4..687cf4141 100644 --- a/monasca_api/api/core/log/model.py +++ b/monasca_api/api/core/log/model.py @@ -15,7 +15,7 @@ from oslo_utils import timeutils import six -from monasca_common.rest import utils as rest_utils +from monasca_api.common.rest import utils as rest_utils def serialize_envelope(envelope): diff --git a/monasca_api/common/rest/utils.py b/monasca_api/common/rest/utils.py index 87b36c522..f6c33b35a 100644 --- a/monasca_api/common/rest/utils.py +++ b/monasca_api/common/rest/utils.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +import simplejson as json import six -import ujson as json from monasca_api.common.rest import exceptions diff --git a/monasca_api/tests/test_helpers.py b/monasca_api/tests/test_helpers.py index 7dc1c7f96..231477eca 100644 --- a/monasca_api/tests/test_helpers.py +++ b/monasca_api/tests/test_helpers.py @@ -22,7 +22,7 @@ from monasca_api.common.policy import policy_engine as policy from monasca_api.tests import base import monasca_api.v2.reference.helpers as helpers -from monasca_common.rest import utils as rest_utils +from monasca_api.common.rest import utils as rest_utils class TestHelpersFunction(base.BaseTestCase): @@ -47,7 +47,7 @@ class TestHelpersFunction(base.BaseTestCase): def test_to_json(self): test_dict = {'test_body': 'test'} - expected_json = '{"test_body":"test"}' + expected_json = '{"test_body": "test"}' response = helpers.to_json(test_dict) self.assertEqual(expected_json, response) diff --git a/monasca_api/tests/test_log_publisher.py b/monasca_api/tests/test_log_publisher.py index d53c201ae..9cd49a969 100644 --- a/monasca_api/tests/test_log_publisher.py +++ b/monasca_api/tests/test_log_publisher.py @@ -20,8 +20,8 @@ import random import mock from oslo_config import cfg from oslo_log import log +import simplejson as json import six -import ujson import unittest from monasca_api.api.core.log import log_publisher @@ -132,7 +132,7 @@ class TestSendMessage(base.BaseTestCase): instance._kafka_publisher.publish.assert_called_once_with( cfg.CONF.kafka.logs_topics[0], - [ujson.dumps(msg, ensure_ascii=False).encode('utf-8')]) + [json.dumps(msg, ensure_ascii=False).encode('utf-8')]) @mock.patch('monasca_api.api.core.log.log_publisher.client_factory' '.get_kafka_producer') @@ -168,7 +168,7 @@ class TestSendMessage(base.BaseTestCase): } ) msg['creation_time'] = creation_time - json_msg = ujson.dumps(msg, ensure_ascii=False) + json_msg = json.dumps(msg, ensure_ascii=False) instance.send_message(msg) @@ -203,7 +203,7 @@ class TestSendMessage(base.BaseTestCase): ) instance.send_message(envelope) - expected_message = ujson.dumps(envelope, ensure_ascii=False) + expected_message = json.dumps(envelope, ensure_ascii=False) if six.PY3: expected_message = expected_message.encode('utf-8') @@ -220,7 +220,7 @@ class TestSendMessage(base.BaseTestCase): @mock.patch('monasca_api.api.core.log.log_publisher.client_factory' '.get_kafka_producer') class TestTruncation(base.BaseTestCase): - EXTRA_CHARS_SIZE = len(bytearray(ujson.dumps({ + EXTRA_CHARS_SIZE = len(bytearray(json.dumps({ 'log': { 'message': None } @@ -276,7 +276,7 @@ class TestTruncation(base.BaseTestCase): envelope_copy = copy.deepcopy(envelope) json_envelope = instance._truncate(envelope_copy) - parsed_envelope = ujson.loads(json_envelope) + parsed_envelope = json.loads(json_envelope) parsed_log_message = parsed_envelope['log']['message'] parsed_log_message_len = len(parsed_log_message) diff --git a/monasca_api/tests/test_logs.py b/monasca_api/tests/test_logs.py index a355eb0de..00a5a6542 100644 --- a/monasca_api/tests/test_logs.py +++ b/monasca_api/tests/test_logs.py @@ -14,7 +14,7 @@ import falcon import mock -import ujson as json +import simplejson as json from monasca_api.tests import base from monasca_api.v2.reference import logs diff --git a/monasca_api/v2/common/helpers.py b/monasca_api/v2/common/helpers.py index b38ad06fc..925d62071 100644 --- a/monasca_api/v2/common/helpers.py +++ b/monasca_api/v2/common/helpers.py @@ -20,7 +20,7 @@ from oslo_log import log from monasca_api.api.core.log import exceptions from monasca_api.api.core.log import validation -from monasca_common.rest import utils as rest_utils +from monasca_api.common.rest import utils as rest_utils LOG = log.getLogger(__name__) diff --git a/monasca_api/v2/reference/helpers.py b/monasca_api/v2/reference/helpers.py index c0f540a30..9f5c240f9 100644 --- a/monasca_api/v2/reference/helpers.py +++ b/monasca_api/v2/reference/helpers.py @@ -24,9 +24,9 @@ from oslo_utils import timeutils import six import six.moves.urllib.parse as urlparse +from monasca_api.common.rest import utils as rest_utils from monasca_api import conf from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError -from monasca_common.rest import utils as rest_utils from monasca_common.validation import metrics as metric_validation diff --git a/requirements.txt b/requirements.txt index 122412885..a89ae871c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,3 +24,4 @@ voluptuous>=0.8.9 # BSD License eventlet!=0.18.3,!=0.20.1,!=0.21.0,!=0.23.0,!=0.25.0,>=0.18.2 # MIT monasca-common>=2.16.0 # Apache-2.0 SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT +simplejson>=3.8.1 # MIT