Merge pull request #2322 from jzelinskie/acifix

image/appc: fix volume conversion and add tests
This commit is contained in:
Jimmy Zelinskie 2017-04-21 10:15:03 -04:00 committed by GitHub
commit 6bef1d1ff3
3 changed files with 24 additions and 3 deletions

View file

@ -59,8 +59,16 @@ class JSONPathDict(object):
def __getitem__(self, path):
return self.get(path)
def __iter__(self):
return self._object.itervalues()
def iterkeys(self):
return self._object.iterkeys()
def get(self, path, not_found_handler=None):
""" Returns the value found at the given path. Path is a json-path expression. """
if self._object == {} or self._object is None:
return None
jsonpath_expr = parse(path)
try:
@ -82,4 +90,3 @@ class JSONPathDict(object):
def keys(self):
return self._object.keys()