Exemple #1
0
 def get_all(cls, context):
     resources_db = db_api.resource_get_all(context)
     resources = [
         (resource_name,
          cls._from_db_object(cls(context), context, resource_db))
         for resource_name, resource_db in six.iteritems(resources_db)
     ]
     return dict(resources)
Exemple #2
0
 def resources_by_logical_name(self, logical_name):
     ret = []
     resources = db_api.resource_get_all(self.cntxt)
     for res in resources:
         if (res.name == logical_name and res.action in ("CREATE", "UPDATE")
            and res.status == "COMPLETE"):
             ret.append(res)
     return ret
Exemple #3
0
 def resources_by_logical_name(self, logical_name):
     ret = []
     resources = db_api.resource_get_all(self.cntxt)
     for res in resources:
         if (res.name == logical_name and res.action in ("CREATE", "UPDATE")
                 and res.status == "COMPLETE"):
             ret.append(res)
     return ret
Exemple #4
0
 def get_all(cls, context):
     resources_db = db_api.resource_get_all(context)
     resources = [
         (
             resource_name,
             cls._from_db_object(cls(context), context, resource_db)
         )
         for resource_name, resource_db in six.iteritems(resources_db)
     ]
     return dict(resources)
Exemple #5
0
    def all_resources(self):
        try:
            resources = db_api.resource_get_all(self.cntxt)
        except exception.NotFound:
            return []

        ret = []
        for res in resources:
            if res.action in ("CREATE", "UPDATE") and res.status == "COMPLETE":
                ret.append(res)
        return ret
Exemple #6
0
    def all_resources(self):
        try:
            resources = db_api.resource_get_all(self.cntxt)
        except exception.NotFound:
            return []

        ret = []
        for res in resources:
            if res.action in ("CREATE", "UPDATE") and res.status == "COMPLETE":
                ret.append(res)
        return ret