From: Philip Joseph Date: Thu, 12 Jan 2017 09:16:22 +0000 (+0000) Subject: Fix merge conflicts X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=3f9eb4a2c6c914740e7af628d46c33fdcb5ed39b;p=osm%2FSO.git Fix merge conflicts Signed-off-by: Philip Joseph --- diff --git a/models/plugins/yang/vnfd.yang b/models/plugins/yang/vnfd.yang index e218a925..fb1bd03e 100644 --- a/models/plugins/yang/vnfd.yang +++ b/models/plugins/yang/vnfd.yang @@ -342,13 +342,6 @@ module vnfd type inet:port-number; } - leaf ssh-key { - description - "Whether SSH keys need to be generated and passed - to the RO and VCA during instantiation."; - type boolean; - } - container dashboard-params { description "Parameters for the VNF dashboard"; diff --git a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py index 3fa827ee..98c88829 100644 --- a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py +++ b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py @@ -1193,39 +1193,28 @@ class ConfigManagerConfig(object): yield from self.process_initial_config(nsr_obj, conf, script) - parameters = [] - try: - parameters = conf['parameter'] - except Exception as e: - self._log.debug("Parameter conf: {}, e: {}". - format(conf, e)) - pass - - inp_file = get_input_file(parameters) - - script = get_script_file(conf['user_defined_script'], - nsd.name, - nsd.id) - - cmd = "{0} {1}".format(script, inp_file) - self._log.debug("Running the CMD: {}".format(cmd)) - - process = yield from asyncio. \ - create_subprocess_shell( - cmd, loop=self._loop, - stdout=asyncio.subprocess.PIPE, - stderr=asyncio.subprocess.PIPE) - yield from process.wait() - if process.returncode: - script_out, script_err = yield from process.communicate() - msg = "NSR {} initial config using {} failed with {}". \ - format(nsr_name, script, process.returncode) - self._log.error(msg) - self._log.error("Script {} stderr: {}". - format(script, script_err)) - raise InitialConfigError(msg) - else: - os.remove(inp_file) + @asyncio.coroutine + def process_vnf_initial_config(self, nsr_obj, vnfr): + '''Apply the initial-config-primitives specified in VNFD''' + + vnfr_name = vnfr.name + + vnfd = vnfr.vnfd + vnf_cfg = vnfd.vnf_configuration + + for conf in vnf_cfg.initial_config_primitive: + self._log.debug("VNFR {} initial config: {}". + format(vnfr_name, conf)) + + if not conf.user_defined_script: + self._log.debug("VNFR {} did not fine user defined script: {}". + format(vnfr_name, conf)) + continue + + script = self.get_script_file(conf.user_defined_script, + vnfd.id, + vnfd.name, + 'vnfd') except KeyError as e: self._log.debug("Did not find initial config: {}".