cot icon indicating copy to clipboard operation
cot copied to clipboard

LookupError on inspection of OVA file

Open gthieleb opened this issue 6 years ago • 2 comments
trafficstars

COT version: 2.2.0 (installed via pip/python2.7/centos7)

When inspecting an OVA file (VMware whitness appliance) the cot info raises an exception:

cot info VPlex-5.4.1.05.00.08-vasa.ova
  File "/home/python/envs/ovftool/lib/python2.7/site-packages/COT/commands/info.py", line 102, in run
    with VMDescription.factory(package, None) as vm:
  File "/home/python/envs/ovftool/lib/python2.7/site-packages/COT/vm_description/vm_description.py", line 164, in factory
    vm = vm_class(input_file, *args, **kwargs)
  File "/home/python/envs/ovftool/lib/python2.7/site-packages/COT/vm_description/ovf/ovf.py", line 236, in __init__
    attrib=self.PRODUCT_SECTION_ATTRIB)
  File "/home/python/envs/ovftool/lib/python2.7/site-packages/COT/xml_file.py", line 156, in find_child
    "\n".join([ET.tostring(e).decode() for e in matches])))
LookupError: Found multiple matching <ProductSection> children (each with attributes '{}') under <VirtualSystem>:
<ovf:ProductSection xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" ovf:required="false">
      <ovf:Info>VM ISV branding information</ovf:Info>
      <ovf:Product>VPLEX VASA Provider</ovf:Product>
      <ovf:Vendor>EMC Corporation</ovf:Vendor>




      <ovf:Version>1.0.0.0</ovf:Version>
      <ovf:FullVersion>VPlex-5.4.1.05.00.08_D35.27_VASA_3</ovf:FullVersion>
      <ovf:ProductUrl />
      <ovf:VendorUrl>http://www.emc.com</ovf:VendorUrl>
      <ovf:AppUrl>http://www.emc.com/products/family/vplex.htm</ovf:AppUrl>
      <ovf:Category>Application</ovf:Category>
      <ovf:Property ovf:key="VASA_USER_NAME" ovf:qualifiers="MinLen(0),MaxLen(65535)" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
        <ovf:Label>VASA User Name</ovf:Label>
        <ovf:Description>A user for the VASA Provider VM which will be authenticated for use when adding this provider in VMware vCenter.

If left empty no user will be created. An existing user will not be created or changed.</ovf:Description>
      </ovf:Property>
      <ovf:Property ovf:key="VASA_USER_PASSWORD" ovf:qualifiers="MinLen(0),MaxLen(65535)" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
        <ovf:Label>VASA User Password</ovf:Label>
        <ovf:Description>The password to be used with the VASA User Name specified above.</ovf:Description>
      </ovf:Property>
    </ovf:ProductSection>

gthieleb avatar Sep 25 '19 18:09 gthieleb

Thanks for the report!

I verified that the OVF specification allows for multiple ProductSection elements, so this is indeed a bug. Can you provide your complete OVF XML content for me to develop a fix against?

glennmatthews avatar Dec 03 '19 17:12 glennmatthews

Duplicate of #73, but I'll leave this open separately until the submitter replies.

glennmatthews avatar Dec 03 '19 17:12 glennmatthews