From a502eb730cb7f5d898769d6958a03c28878332bb Mon Sep 17 00:00:00 2001 From: ahothan Date: Sat, 22 Jun 2019 12:21:38 -0700 Subject: NFVBENCH-138 Use yaml.safe_load() instead of unsafe yaml load Change-Id: Ifa1796b8dbc1bc5d92dd765a18b9b8022d3b3289 Signed-off-by: ahothan --- docker/Dockerfile | 2 +- nfvbench/traffic_server.py | 2 +- nfvbenchvm/dib/build-image.sh | 2 +- nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0e8603e..920e3a3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:16.04 ENV TREX_VER "v2.56" -ENV VM_IMAGE_VER "0.8" +ENV VM_IMAGE_VER "0.9" # Note: do not clone with --depth 1 as it will cause pbr to fail extracting the nfvbench version # from the git tag diff --git a/nfvbench/traffic_server.py b/nfvbench/traffic_server.py index 91608dd..dd36074 100644 --- a/nfvbench/traffic_server.py +++ b/nfvbench/traffic_server.py @@ -66,7 +66,7 @@ class TRexTrafficServer(TrafficServer): if os.path.exists(filename): with open(filename, 'r') as stream: try: - result = yaml.load(stream) + result = yaml.safe_load(stream) except yaml.YAMLError as exc: print exc return result diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh index 9acb028..588e454 100755 --- a/nfvbenchvm/dib/build-image.sh +++ b/nfvbenchvm/dib/build-image.sh @@ -30,7 +30,7 @@ set -e gs_url=artifacts.opnfv.org/nfvbench/images # image version number -__version__=0.8 +__version__=0.9 image_name=nfvbenchvm_centos-$__version__ # if image exists skip building diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit index 3e4647a..dc51030 100755 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit @@ -5,7 +5,7 @@ cloudcfg = "/etc/cloud/cloud.cfg" user = "cloud-user" with open(cloudcfg) as f: - cfg = yaml.load(f) + cfg = yaml.safe_load(f) try: if cfg['system_info']['default_user']['name']: -- cgit 1.2.3-korg