X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fvnf.py;h=1c79aed6544af489e8f561d6a3b81df65c6b5944;hp=31e48773671c2428954c446576706d5de00dcb15;hb=bf79352ca652b228c5c216564cc512b635e3c5e4;hpb=136186e189027698662452ee00a5e50ebe82384f diff --git a/n2vc/vnf.py b/n2vc/vnf.py index 31e4877..1c79aed 100644 --- a/n2vc/vnf.py +++ b/n2vc/vnf.py @@ -485,11 +485,12 @@ class N2VC: # ####################################### # # Execute initial config primitive(s) # # ####################################### - await self.ExecuteInitialPrimitives( + uuids = await self.ExecuteInitialPrimitives( model_name, application_name, params, ) + return uuids # primitives = {} # @@ -884,11 +885,15 @@ class N2VC: params = {} for parameter in parameters: param = str(parameter['name']) + value = None + + # If there's no value, use the default-value (if set) + if parameter['value'] is None and 'default-value' in parameter: + value = parameter['default-value'] # Typecast parameter value, if present if 'data-type' in parameter: paramtype = str(parameter['data-type']).lower() - value = None if paramtype == "integer": value = int(parameter['value']) @@ -896,6 +901,9 @@ class N2VC: value = bool(parameter['value']) else: value = str(parameter['value']) + else: + # If there's no data-type, assume the value is a string + value = str(parameter['value']) if parameter['value'] == "": params[param] = str(values[parameter['value']]) @@ -917,7 +925,6 @@ class N2VC: return config - @staticmethod def FormatApplicationName(self, *args): """ Generate a Juju-compatible Application name @@ -933,7 +940,6 @@ class N2VC: FormatApplicationName("ping_pong_ns", "ping_vnf", "a") """ - appname = "" for c in "-".join(list(args)): if c.isdigit():