Merge "Remove MEMOIZE from get_pod_ip"

This commit is contained in:
Zuul 2020-04-13 08:58:23 +00:00 committed by Gerrit Code Review
commit 27954f3f47
1 changed files with 0 additions and 16 deletions

View File

@ -16,7 +16,6 @@
import urllib import urllib
from openstack import exceptions as os_exc from openstack import exceptions as os_exc
from oslo_cache import core as cache
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
@ -34,20 +33,6 @@ LOG = log.getLogger(__name__)
CONF = cfg.CONF CONF = cfg.CONF
pod_ip_caching_opts = [
cfg.BoolOpt('caching', default=True),
cfg.IntOpt('cache_time', default=3600),
]
CONF.register_opts(pod_ip_caching_opts, "pod_ip_caching")
cache.configure(CONF)
pod_ip_cache_region = cache.create_region()
MEMOIZE = cache.get_memoization_decorator(
CONF, pod_ip_cache_region, "pod_ip_caching")
cache.configure_cache_region(CONF, pod_ip_cache_region)
def get_network_id(subnets): def get_network_id(subnets):
ids = list(set(net.id for net in subnets.values())) ids = list(set(net.id for net in subnets.values()))
@ -275,7 +260,6 @@ def create_security_group_rule_body(
return security_group_rule_body return security_group_rule_body
@MEMOIZE
def get_pod_ip(pod): def get_pod_ip(pod):
try: try:
pod_metadata = pod['metadata']['annotations'] pod_metadata = pod['metadata']['annotations']