From e783927ea0f580dea67152bc51ef336503339a7f Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Sat, 2 May 2015 12:16:00 +0200 Subject: [PATCH] Fix #139. Adjust Debian OS type depending on architecture --- bootstrapvz/plugins/vagrant/assets/box.ovf | 6 +++--- bootstrapvz/plugins/vagrant/tasks.py | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bootstrapvz/plugins/vagrant/assets/box.ovf b/bootstrapvz/plugins/vagrant/assets/box.ovf index 9f8d7f7..1bcb6e1 100644 --- a/bootstrapvz/plugins/vagrant/assets/box.ovf +++ b/bootstrapvz/plugins/vagrant/assets/box.ovf @@ -15,10 +15,10 @@ A virtual machine - + The kind of installed guest operating system - Debian_64 - Debian_64 + [OS_DESCRIPTION] + [OS_TYPE] Virtual hardware requirements for a virtual machine diff --git a/bootstrapvz/plugins/vagrant/tasks.py b/bootstrapvz/plugins/vagrant/tasks.py index 90ad443..776f1c3 100644 --- a/bootstrapvz/plugins/vagrant/tasks.py +++ b/bootstrapvz/plugins/vagrant/tasks.py @@ -189,6 +189,17 @@ class PackageBox(Task): [system] = root.findall('./ovf:VirtualSystem', namespaces) attr(system, 'ovf:id', info._vagrant['box_name']) + # Set the operating system + [os_section] = system.findall('./ovf:OperatingSystemSection', namespaces) + os_info = {'i386': {'id': 96, 'name': 'Debian'}, + 'amd64': {'id': 96, 'name': 'Debian_64'} + }.get(info.manifest.system['architecture']) + attr(os_section, 'ovf:id', os_info['id']) + [os_desc] = os_section.findall('./ovf:Description', namespaces) + os_desc.text = os_info['name'] + [os_type] = os_section.findall('./vbox:OSType', namespaces) + os_type.text = os_info['name'] + [sysid] = system.findall('./ovf:VirtualHardwareSection/ovf:System/' 'vssd:VirtualSystemIdentifier', namespaces) sysid.text = info._vagrant['box_name']