# TODO parse input and translate to VIM format (openmano_schemas.new_vminstance_response_schema)
server_dict = server.to_dict()
try:
- server_dict["flavor"]["id"] = self.nova.flavors.find(
- name=server_dict["flavor"]["original_name"]
- ).id
+ if server_dict["flavor"].get("original_name"):
+ server_dict["flavor"]["id"] = self.nova.flavors.find(
+ name=server_dict["flavor"]["original_name"]
+ ).id
except nClient.exceptions.NotFound as e:
self.logger.warning(str(e.message))
return server_dict
all_servers = self.nova.servers.list(detailed=True)
try:
for server in all_servers:
- server.flavor["id"] = self.nova.flavors.find(
- name=server.flavor["original_name"]
- ).id
+ if server.flavor.get("original_name"):
+ server.flavor["id"] = self.nova.flavors.find(
+ name=server.flavor["original_name"]
+ ).id
except nClient.exceptions.NotFound as e:
self.logger.warning(str(e.message))
all_ports = self.neutron.list_ports()
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+fixes:
+ - |
+ Fix Bug 2272 - NS instantiation fails in VIMs with microversion with a KeyError 'original_name'.
+ With this fix, now Key `original_name` is only used when working with the newer version of the
+ nova API.
\ No newline at end of file