Exemple #1
0
    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
Exemple #2
0
    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
Exemple #3
0
 def test_001_flatten(self):
     HEADING()
     f = flatten(self.d)
     pprint (f)
     assert f['extra__minDisk'] == 40