diff --git a/lookup_plugins/re2oapi.py b/lookup_plugins/re2oapi.py index ae506e0c..2d461d82 100644 --- a/lookup_plugins/re2oapi.py +++ b/lookup_plugins/re2oapi.py @@ -749,15 +749,15 @@ class LookupModule(LookupBase): def _get_prefix(self, api_client, subnet_name): prefixv6 = None - if self._is_cached(subnet_name): + if self._is_cached(subnet_name + '_v6'): display.vvv("Found subnet {} in cache.".format(subnet_name)) - prefixv6 = self._get_cache(subnet_name) + prefixv6 = self._get_cache(subnet_name + '_v6') else: Mtypes = self._rawquery(api_client, 'machines/iptype') iptype = list(filter(lambda x: x['type'] == subnet_name, Mtypes)) prefixv6 = iptype[0]['prefix_v6'] + '/64' display.vvv("Storing subnet {} in cache".format(subnet_name)) - self._set_cache(subnet_name, prefixv6) + self._set_cache(subnet_name + '_v6', prefixv6) return prefixv6 def _get_cidrs(self, api_client, subnet_name):