diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index 3228a0d..0489f02 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -41,7 +41,7 @@ echo "Tests executed by user: $(whoami)" cd /son-emu/ # trigger pep8 style check echo "Doing flake8 style check ..." -flake8 --exclude=.eggs,devops --ignore=E501 . +flake8 --exclude=.eggs,devops --ignore=E501,W605,W504 . echo "done." # trigger the tests echo "Running unit tests ..." diff --git a/pipeline_local.sh b/pipeline_local.sh index e6e4018..1af9336 100755 --- a/pipeline_local.sh +++ b/pipeline_local.sh @@ -3,9 +3,13 @@ set -e # trigger pep8 style check echo "Doing flake8 style check ..." -flake8 --exclude=.eggs,devops --ignore=E501 . +flake8 --exclude=.eggs,devops --ignore=E501,W605,W504 . echo "done." # trigger the tests echo "Running unit tests ..." sudo pytest -v +# do everything in Docker, like it is done by Jenkins +docker build -t vim-emu-loc-test . +docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test pytest -v +docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test flake8 --exclude=.eggs,devops --ignore=E501,W605,W504 . echo "done." diff --git a/setup.py b/setup.py index 090063a..7cc9d6b 100755 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ 'Flask', 'flask_restful', 'docker==2.0.2', - 'urllib3==1.21.1', + 'urllib3', 'requests', 'prometheus_client', 'ipaddress', diff --git a/src/emuvim/dcemulator/monitoring.py b/src/emuvim/dcemulator/monitoring.py index 6ed87cb..f8280c3 100755 --- a/src/emuvim/dcemulator/monitoring.py +++ b/src/emuvim/dcemulator/monitoring.py @@ -335,10 +335,10 @@ def stop_metric(self, vnf_name, vnf_interface=None, metric=None): return 'Error stopping monitoring metric: {0} on {1}:{2}'.format( metric, vnf_name, vnf_interface) - -# get all metrics defined in the list and export it to Prometheus - def get_flow_metrics(self): + """ + Get all metrics defined in the list and export it to Prometheus. + """ while self.start_monitoring: self.monitor_flow_lock.acquire()