From 31aa7e168285ccc8178be81c5ec3fb1007e3d0b5 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Aug 05 2016 13:13:52 +0000 Subject: let xmd be None or dict spec says it can be None: A dictionary of user-defined keys and values. May be null. Signed-off-by: Tomas Tomecek --- diff --git a/modulemd/__init__.py b/modulemd/__init__.py index f0ce750..a9d1f10 100644 --- a/modulemd/__init__.py +++ b/modulemd/__init__.py @@ -299,8 +299,10 @@ class ModuleMetadata(object): raise TypeError("documentation must be a string") if not isinstance(self.tracker, str): raise TypeError("tracker must be a string") - if not isinstance(self.xmd, dict): - raise TypeError("xmd must be a dictionary") + if self.xmd is not None and not isinstance(self.xmd, dict): + raise TypeError( + "xmd must be a dictionary or null, current value: {!r}".format(self.xmd) + ) if not isinstance(self.profiles, dict): raise TypeError("profiles must be a dictionary") for p in self.profiles.keys():