From: David Garcia Date: Thu, 15 Apr 2021 08:15:29 +0000 (+0200) Subject: Fix bug 1505 X-Git-Tag: v9.1.2~8 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=ef97868ad5cd90e5da812ceed1a0467b1c8f705b;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 64b93cc..bd3cb56 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")