From ebbc4942b7fc35dbbaa676dd8bb9582df7bca152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Fri, 20 Apr 2018 10:42:36 +0200 Subject: [PATCH] Fixed creation of machine settings file If no vmnic setup is present a request to iterator over a NoneType object is attempted and failed. This Fixes #710 --- kiwi/xml_state.py | 2 ++ test/unit/xml_state_test.py | 1 + 2 files changed, 3 insertions(+) diff --git a/kiwi/xml_state.py b/kiwi/xml_state.py index f6ae6018..15e682d3 100644 --- a/kiwi/xml_state.py +++ b/kiwi/xml_state.py @@ -633,6 +633,8 @@ class XMLState(object): machine_section = self.get_build_type_machine_section() if machine_section: return machine_section.get_vmnic() + else: + return [] def get_build_type_vmdvd_section(self): """ diff --git a/test/unit/xml_state_test.py b/test/unit/xml_state_test.py index 0b4251d4..5da68993 100644 --- a/test/unit/xml_state_test.py +++ b/test/unit/xml_state_test.py @@ -199,6 +199,7 @@ class TestXMLState(object): def test_get_build_type_vmnic_entries(self): assert self.state.get_build_type_vmnic_entries()[0].get_interface() \ == '' + assert self.boot_state.get_build_type_vmnic_entries() == [] def test_get_build_type_vmdvd_section(self): assert self.state.get_build_type_vmdvd_section().get_id() == 0