Make scheduler code use object with good practice
commit 6c32576b
move objects definition into object folder directly,
all other modules do not need to import other objects modules.
So current code didn't use good practice of objects usage and this
patch adjusts the code to use objects better.
Change-Id: I256dc9e3a2802a5c54d4d5e38f0b11039c031e96
This commit is contained in:
parent
6d7f07cc7b
commit
0f58a65adc
|
@ -16,7 +16,7 @@
|
|||
|
||||
|
||||
from nova.i18n import _LI
|
||||
from nova.objects import aggregate
|
||||
from nova import objects
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -27,7 +27,7 @@ def aggregate_values_from_db(context, host, key_name):
|
|||
# TODO(sahid): DB query in filter is a performance hit, especially for
|
||||
# system with lots of hosts. Will need a general solution here to fix
|
||||
# all filters with aggregate DB call things.
|
||||
aggrlist = aggregate.AggregateList.get_by_host(
|
||||
aggrlist = objects.AggregateList.get_by_host(
|
||||
context.elevated(), host, key=key_name)
|
||||
aggregate_vals = set(aggr.metadata[key_name] for aggr in aggrlist)
|
||||
return aggregate_vals
|
||||
|
|
Loading…
Reference in New Issue