X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fvnf.py;h=9f8360b2ac92ac3525f643c83876eb4f8bf9b1f8;hp=38a9d154482d64925772c25836f7c8b8832072f4;hb=e3a05f81eb77deac1fa0f2901960597d38f45d54;hpb=b2a07f566be558a8b59b8b5dedfe8da5ae1b0132 diff --git a/n2vc/vnf.py b/n2vc/vnf.py index 38a9d15..9f8360b 100644 --- a/n2vc/vnf.py +++ b/n2vc/vnf.py @@ -246,9 +246,15 @@ class N2VC: is bootstrapped to. This method will write the public key to disk in that location: ~/.local/share/juju/ssh/juju_id_rsa.pub """ + # Make sure that we have a public key before writing to disk if public_key is None or len(public_key) == 0: - return - + if 'OSM_VCA_PUBKEY' in os.environ: + public_key = os.getenv('OSM_VCA_PUBKEY', '') + if len(public_key == 0): + return + else: + return + path = "{}/.local/share/juju/ssh".format( os.path.expanduser('~'), )