From fb6dd284fad64a4b69e44aea38852b38819b5eb1 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 18 Feb 2022 16:02:16 +0100 Subject: make "uuid" an optional property --- src/hydrilla/server/serve.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/hydrilla/server') diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py index bb53c0a..9bcfb93 100644 --- a/src/hydrilla/server/serve.py +++ b/src/hydrilla/server/serve.py @@ -57,7 +57,7 @@ class ItemInfo(ABC): """Initialize ItemInfo using item definition read from JSON.""" self.version = util.normalize_version(item_obj['version']) self.identifier = item_obj['identifier'] - self.uuid = item_obj['uuid'] + self.uuid = item_obj.get('uuid') self.long_name = item_obj['long_name'] def path(self) -> str: @@ -111,8 +111,11 @@ class VersionedItemInfo: """ if self.identifier is None: self.identifier = item_info.identifier + + if self.uuid is None: self.uuid = item_info.uuid - elif self.uuid != item_info.uuid: + + if self.uuid is not None and self.uuid != item_info.uuid: raise ValueError(f_('uuid_mismatch_{identifier}') .format(identifier=self.identifier)) -- cgit v1.2.3