X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fosmclient.git;a=blobdiff_plain;f=osmclient%2Fsol005%2Fns.py;fp=osmclient%2Fsol005%2Fns.py;h=1165b3de9bbb548931f38342c332241a1edd5a7b;hp=8a9c9f022dbbac714f8188c3a542e03d06d4e9b0;hb=e79f0cafb1e4f8b065708187c6dd0f58b56a2aeb;hpb=b7463a4821eabd214b2b38d54db38a5a1aae53d6 diff --git a/osmclient/sol005/ns.py b/osmclient/sol005/ns.py index 8a9c9f0..1165b3d 100644 --- a/osmclient/sol005/ns.py +++ b/osmclient/sol005/ns.py @@ -314,11 +314,11 @@ class Ns(object): str(exc)) raise ClientException(message) - def exec_op(self, name, op_name, op_data=None, wait=False): + def exec_op(self, name, op_name, op_data=None, wait=False, ): """Executes an operation on a NS """ - ns = self.get(name) try: + ns = self.get(name) self._apiResource = '/ns_instances' self._apiBase = '{}{}{}'.format(self._apiName, self._apiVersion, self._apiResource) @@ -338,7 +338,7 @@ class Ns(object): # Wait for status for NS instance action # For the 'action' operation, 'id' is used self._wait(resp.get('id')) - print(resp['id']) + return resp['id'] else: msg = "" if resp: @@ -369,7 +369,8 @@ class Ns(object): "member-vnf-index": vnf_name, "scaling-group-descriptor": scaling_group, } - self.exec_op(ns_name, op_name='scale', op_data=op_data, wait=wait) + op_id = self.exec_op(ns_name, op_name='scale', op_data=op_data, wait=wait) + print(str(op_id)) except ClientException as exc: message="failed to scale vnf {} of ns {}:\nerror:\n{}".format( vnf_name, ns_name, str(exc))