From: David Garcia Date: Thu, 15 Apr 2021 08:15:29 +0000 (+0200) Subject: Fix bug 1505 X-Git-Tag: branch-sol006v331-start~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=19da2b852804c27c7d04484eea89feb212874254;p=osm%2FN2VC.git Fix bug 1505 Delete ssh-key generation in N2VCConnector initialization Change-Id: I5f33adf683ffeef34de270bf9b458a172dd4059d Signed-off-by: David Garcia --- diff --git a/n2vc/n2vc_conn.py b/n2vc/n2vc_conn.py index eada20b..ad0dc28 100644 --- a/n2vc/n2vc_conn.py +++ b/n2vc/n2vc_conn.py @@ -117,7 +117,6 @@ class N2VCConnector(abc.ABC, Loggable): # generate private/public key-pair self.private_key_path = None self.public_key_path = None - self.get_public_key() @abc.abstractmethod async def get_status(self, namespace: str, yaml_format: bool = True): diff --git a/n2vc/tests/unit/test_n2vc_juju_conn.py b/n2vc/tests/unit/test_n2vc_juju_conn.py index 1f723fe..e5e26be 100644 --- a/n2vc/tests/unit/test_n2vc_juju_conn.py +++ b/n2vc/tests/unit/test_n2vc_juju_conn.py @@ -15,6 +15,9 @@ import asyncio import logging +from unittest.mock import Mock + + import asynctest from n2vc.n2vc_juju_conn import N2VCJujuConnector from osm_common import fslocal @@ -51,6 +54,7 @@ class N2VCJujuConnTestCase(asynctest.TestCase): logging.disable(logging.CRITICAL) + N2VCJujuConnector.get_public_key = Mock() self.n2vc = N2VCJujuConnector( db=db, fs=fslocal.FsLocal(), @@ -61,6 +65,7 @@ class N2VCJujuConnTestCase(asynctest.TestCase): vca_config=vca_config, on_update_db=None, ) + N2VCJujuConnector.get_public_key.assert_not_called() @asynctest.mock.patch("n2vc.libjuju.Libjuju.get_metrics") diff --git a/tox.ini b/tox.ini index 21fc186..816de79 100644 --- a/tox.ini +++ b/tox.ini @@ -110,6 +110,7 @@ whitelist_externals = sh ignore = W291, W293, + W503, E123, E125, E226,