X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fvnf.py;h=87d5df409fc5bf1afe1d3a3c0ac720f54be81e5b;hp=0d9530e01b91e3b84c90549f9036451b3cbcbfcc;hb=38bf16409f00241925f7d09eb14fab49a3096e80;hpb=c92163f142d07c6bb213354398d9befd70efaacd diff --git a/n2vc/vnf.py b/n2vc/vnf.py index 0d9530e..87d5df4 100644 --- a/n2vc/vnf.py +++ b/n2vc/vnf.py @@ -457,8 +457,8 @@ class N2VC: if all(k in machine_spec for k in ['host', 'user']): # Enlist an existing machine as a Juju unit machine = await model.add_machine(spec='ssh:{}@{}:{}'.format( - machine_spec['user'], - machine_spec['host'], + machine_spec['username'], + machine_spec['hostname'], self.GetPrivateKeyPath(), )) to = machine.id @@ -503,10 +503,19 @@ class N2VC: # Where to deploy the charm to. to=to, ) - - # Map the vdu id<->app name, - # - await self.Relate(model_name, vnfd) + ############################# + # Map the vdu id<->app name # + ############################# + try: + await self.Relate(model_name, vnfd) + except KeyError as ex: + # We don't currently support relations between NS and VNF/VDU charms + self.log.warn("[N2VC] Relations not supported: {}".format(ex)) + except Exception as ex: + # This may happen if not all of the charms needed by the relation + # are ready. We can safely ignore this, because Relate will be + # retried when the endpoint of the relation is deployed. + self.log.warn("[N2VC] Relations not ready") # ####################################### # # Execute initial config primitive(s) #