Fix unitests

-Remove ujson from requirements file, replace ujson with json
-Limit bandit version
-Fix docker build script

Change-Id: I10ddf86872b318a9d2e920e0aa003d2ca08f951e
This commit is contained in:
Adrian Czarnecki 2021-09-01 13:55:40 -07:00
parent d562bc38c5
commit 038fb296bd
6 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@
set -x # Print each script step.
set -eo pipefail # Exit the script if any statement returns error.
REAL_PATH=$(python -c "import os,sys;print(os.path.realpath('$0'))")
REAL_PATH=$(python3 -c "import os,sys;print(os.path.realpath('$0'))")
cd "$(dirname "$REAL_PATH")/../docker/"
BASE_GIT_COMMIT=$(git rev-parse --verify HEAD)

View File

@ -7,13 +7,13 @@ debtcollector==1.2.0
docutils==0.11
extras==1.0.0
fixtures==3.0.0
flake8==2.5.5
flake8==2.6.0
future==0.16.0
gevent==1.2.2
gitdb==0.6.4
GitPython==1.0.1
greenlet==0.4.10
hacking==0.12.0
hacking==1.1.0
httplib2==0.9.1
iso8601==0.1.11
kazoo==2.2

View File

@ -12,8 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
import six
import ujson as json
from monasca_common.rest import exceptions

View File

@ -13,12 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import math
import re
import sys
import six
import sys
import ujson
# This is used to ensure that metrics with a timestamp older than
# RECENT_POINT_THRESHOLD_DEFAULT seconds (or the value passed in to
@ -108,7 +108,7 @@ def validate_value_meta(value_meta):
raise InvalidValueMeta(msg)
try:
value_meta_json = ujson.dumps(value_meta)
value_meta_json = json.dumps(value_meta)
except Exception:
raise InvalidValueMeta("Unable to serialize valueMeta into JSON")
if len(value_meta_json) > VALUE_META_VALUE_MAX_LENGTH:

View File

@ -8,5 +8,4 @@ oslo.config>=5.2.0 # Apache-2.0
oslo.policy>=1.30.0 # Apache-2.0
pbr!=2.1.0,>=2.0.0 # Apache-2.0
pyparsing>=2.1.0 # MIT
ujson>=1.35 # BSD
confluent-kafka>=0.11.4 # Apache-2.0

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# Hacking already pins down pep8, pyflakes and flake8
bandit!=1.6.0,>=1.1.0 # Apache-2.0
bandit!=1.6.0,>=1.1.0,<=1.6.2
hacking>=1.1.0,<1.2.0 # Apache-2.0
Babel!=2.4.0,>=2.3.4 # BSD
coverage!=4.4,>=4.0 # Apache-2.0