Пример #1
0
    def ListFlavors(self, isDetail = False):
        """Returns a list of flavors"""
        if isDetail:
            method = "/flavors/detail"
        else:
            method = "/flavors"
        flavors = self.rsClient.SendRequest(rType = "GET", method = method, data = None, params = None)
        flavorsList = []

        for flavor in simplejson.loads(flavors['body'])['flavors']:
            fl = RawMapper(flavor)
            flavorsList.append(fl.getObject())
        return flavorsList
Пример #2
0
 def testCoreDeletion(self):
     rm = RawMapper(self.sampleObject)
     rm.clearProperty('d')
     o = rm.getObject()
     assert not hasattr(o, 'd')
Пример #3
0
 def __init__(self, srv):
     RawMapper.__init__(self, srv)
     self.customMapper('state', "self.mapState()")
     self.clearProperty('status')
     self.clearProperty('progress')