From: garciadeblas Date: Tue, 28 Mar 2023 22:08:39 +0000 (+0200) Subject: Fix black and cover errors X-Git-Tag: v13.0.2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=3666291d229e922ee666018fc543d1d2ffb7ddc6;p=osm%2FMON.git Fix black and cover errors Change-Id: I1c7fb47a94ac0ce99c5b6fffb44aca3d80cd3842 Signed-off-by: garciadeblas --- diff --git a/osm_mon/cmd/mon_utils.py b/osm_mon/cmd/mon_utils.py index 83dd130..88e7500 100644 --- a/osm_mon/cmd/mon_utils.py +++ b/osm_mon/cmd/mon_utils.py @@ -22,7 +22,6 @@ import kafka def wait_till_commondb_is_ready(config, process_name="osm-mon", commondb_wait_time=5): - logging.debug("wait_till_commondb_is_ready") while True: @@ -39,7 +38,6 @@ def wait_till_commondb_is_ready(config, process_name="osm-mon", commondb_wait_ti def wait_till_kafka_is_ready(config, process_name="osm-mon", kafka_wait_time=5): - logging.debug("wait_till_kafka_is_ready") while True: @@ -98,7 +96,6 @@ def wait_till_kafka_is_ready(config, process_name="osm-mon", kafka_wait_time=5): def wait_till_core_services_are_ready( config, process_name="osm-mon", commondb_wait_time=5, kafka_wait_time=5 ): - logging.debug("wait_till_core_services_are_ready") if not config: diff --git a/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py b/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py index 2196326..8164510 100644 --- a/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py +++ b/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py @@ -103,7 +103,6 @@ class vROPS_Helper: return resource_list def get_metrics(self, vdu_mappings={}, monitoring_params={}, vnfr=None, tags={}): - monitoring_keys = {} # Collect the names of all the metrics we need to query for metric_entry in monitoring_params: @@ -132,7 +131,6 @@ class vROPS_Helper: vdu_mappings = sanitized_vdu_mappings try: - # Now we can make a single call to vROPS to collect all relevant metrics for resources we need to monitor api_url = ( "/suite-api/api/resources/stats?IntervalType=MINUTES&IntervalCount=1" diff --git a/osm_mon/server/server.py b/osm_mon/server/server.py index 165888b..f05cdec 100755 --- a/osm_mon/server/server.py +++ b/osm_mon/server/server.py @@ -66,7 +66,6 @@ class Server: async def _process_msg(self, topic, key, values): log.info("Message arrived: %s", values) try: - if topic == "alarm_request": if key == "create_alarm_request": alarm_details = values["alarm_create_request"] diff --git a/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vcd_collector.py b/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vcd_collector.py index 3d92fd5..adb84c7 100644 --- a/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vcd_collector.py +++ b/osm_mon/tests/unit/collector/vnf_collectors/vmware/test_vcd_collector.py @@ -67,7 +67,6 @@ class CollectorTest(TestCase): super().tearDown() def test_collect_cpu_and_memory(self, mock_vm_moref_id): - mock_vm_moref_id.return_value = "VMWARE-OID-VM-1" self.vnfd["vdu"][0]["monitoring-parameter"] = [ {"id": "ubuntu_vnf_cpu_util", "performance-metric": "cpu_utilization"}, diff --git a/requirements-dev.in b/requirements-dev.in index e39d08c..3f330aa 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. --e git+https://osm.etsi.org/gerrit/osm/common.git@master#egg=osm-common +-e git+https://osm.etsi.org/gerrit/osm/common.git@v13.0#egg=osm-common -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v13.0 --e git+https://osm.etsi.org/gerrit/osm/N2VC.git@master#egg=n2vc +-e git+https://osm.etsi.org/gerrit/osm/N2VC.git@v13.0#egg=n2vc -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v13.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 6e5a633..3f809e8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,9 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### --e git+https://osm.etsi.org/gerrit/osm/N2VC.git@master#egg=n2vc +-e git+https://osm.etsi.org/gerrit/osm/N2VC.git@v13.0#egg=n2vc # via -r requirements-dev.in --e git+https://osm.etsi.org/gerrit/osm/common.git@master#egg=osm-common +-e git+https://osm.etsi.org/gerrit/osm/common.git@v13.0#egg=osm-common # via -r requirements-dev.in aiokafka==0.7.2 # via -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v13.0 diff --git a/tox.ini b/tox.ini index 4844552..4679635 100644 --- a/tox.ini +++ b/tox.ini @@ -50,7 +50,7 @@ commands = coverage report --omit='*tests*' coverage html -d ./cover --omit='*tests*' coverage xml -o coverage.xml --omit=*tests* -whitelist_externals = sh +allowlist_externals = sh #######################################################################################