Skip to content

Commit

Permalink
Merge pull request #39 from vmware/topic/okurth/fix-missing-transport…
Browse files Browse the repository at this point in the history
…s-etc

do not fail if 'transports' or 'categories' are missing
  • Loading branch information
oliverkurth authored Oct 26, 2023
2 parents 5f79032 + f3a34ad commit ae27b0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ova-compose/ova-compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ def __init__(self, **kwargs):
for k, v in props.items():
self.properties.append(OVFProperty(k, **v))

self.transports = kwargs.get('transports', None)
self.categories = kwargs.get('categories', None)
self.transports = kwargs.get('transports', [])
self.categories = kwargs.get('categories', {})

# if a property references a non-existing category it will be dropped
for prop in self.properties:
Expand Down Expand Up @@ -867,6 +867,8 @@ def from_dict(cls, config):
annotation = None
eula = None

assert 'hardware' in config, "config needs a 'hardware' section"

hardware = config['hardware']
for hw_id, hw in hardware.items():
if isinstance(hw, dict):
Expand Down

0 comments on commit ae27b0b

Please sign in to comment.