def flatten_vm(cls, d): """ flattens the data from a single vm returned by libloud :param d: the data for that vm :type d: dict :return: the flattened dict :rtype: dict """ n = key_prefix_replace(flatten(d), ["extra__"], "") return n
def flatten_image(cls, d): """ flattens the data from a single image returned with libcloud. :param d: the data for that image :type d: dict :return: the flattened dict :rtype: dict """ n = key_prefix_replace(flatten(d), ["extra__metadata__", "extra__"], "") return n
def test_001_flatten(self): HEADING() f = flatten(self.d) pprint (f) assert f['extra__minDisk'] == 40