Пример #1
0
    def get_by_metadata_key(cls, context, key, hosts=None):
        api_db_aggregates = [cls._fill_deprecated(agg) for agg in
                            _get_by_metadata_key_from_db(context, key=key)]
        db_aggregates = db.aggregate_get_by_metadata_key(context, key=key)

        all_aggregates = db_aggregates + api_db_aggregates
        if hosts is not None:
            all_aggregates = cls._filter_db_aggregates(all_aggregates, hosts)
        return base.obj_make_list(context, cls(context), objects.Aggregate,
                                  all_aggregates)
Пример #2
0
 def get_by_metadata_key(cls, context, key, hosts=None):
     db_aggregates = db.aggregate_get_by_metadata_key(context, key=key)
     if hosts:
         db_aggregates = cls._filter_db_aggregates(db_aggregates, hosts)
     return base.obj_make_list(context, cls(context), objects.Aggregate, db_aggregates)
Пример #3
0
 def get_by_metadata_key(cls, context, key, hosts=None):
     db_aggregates = db.aggregate_get_by_metadata_key(context, key=key)
     if hosts is not None:
         db_aggregates = cls._filter_db_aggregates(db_aggregates, hosts)
     return base.obj_make_list(context, cls(context), objects.Aggregate,
                               db_aggregates)