Fixed bug while loading empty metadata

Change-Id: I50d6a55069f687c4b858a6056826d338db294148
This commit is contained in:
Stéphane Albert 2014-11-07 17:11:43 +01:00
parent b4e44f9060
commit 95ac7bd6bb
1 changed files with 3 additions and 1 deletions

View File

@ -116,7 +116,9 @@ class DBStateManager(object):
def get_metadata(self):
"""Get metadata attached to the state."""
return json.loads(self._db.get_metadata(self._state_name))
data = self._db.get_metadata(self._state_name)
if data:
return json.loads(data)
def set_metadata(self, metadata):
"""Set metadata attached to the state."""