'Refresh the neutron extensions cache when necessary.'

def _refresh_neutron_extensions_cache(self, context, neutron=None):

    if ((not self.last_neutron_extension_sync) or ((time.time() - self.last_neutron_extension_sync) >= CONF.neutron.extension_sync_interval)):
        if (neutron is None):
            neutron = get_client(context)
        extensions_list = neutron.list_extensions()['extensions']
        self.last_neutron_extension_sync = time.time()
        self.extensions.clear()
        self.extensions = {ext['name']: ext for ext in extensions_list}
