def get_defaults(self, context, config_defaults): """Get default quota values. If the default class is defined, use the values defined in the class, otherwise use the values from the config. :param context: :param config_defaults: :return: """ quotas = {} default_quotas = {} if CONF.use_default_quota_class: default_quotas = db_api.quota_class_get_default(context) for resource, default in config_defaults.items(): # get rid of the 'quota_' prefix resource_name = resource[6:] if default_quotas: if resource_name not in default_quotas: versionutils.report_deprecated_feature( LOG, _("Default quota for resource: %(res)s is set " "by the default quota flag: quota_%(res)s, " "it is now deprecated. Please use the " "default quota class for default " "quota.") % {'res': resource_name}) quotas[resource_name] = default_quotas.get(resource_name, default) return quotas
def __init__(self, *args, **kwargs): super(EndpointFilterExtension, self).__init__(*args, **kwargs) msg = _("Remove endpoint_filter_extension from the paste pipeline, " "the endpoint filter extension is now always available. " "Update the [pipeline:api_v3] section in keystone-paste.ini " "accordingly as it will be removed in the O release.") versionutils.report_deprecated_feature(LOG, msg)
def update_lport(self, context, lport_id, original, updated): # This api is deprecated because of the irrelevant context arg versionutils.report_deprecated_feature( LOG, 'security.NsxLibNsGroup.update_lport is deprecated. ' 'Please use security.NsxLibNsGroup.update_lport_nsgroups instead.') return self.update_lport_nsgroups(lport_id, original, updated)
def _get_filtered_pools(self): """Return available pools filtered by a pool name search pattern.""" # Inform deprecation of legacy option. if self.configuration.safe_get('netapp_volume_list'): msg = _LW("The option 'netapp_volume_list' is deprecated and " "will be removed in the future releases. Please use " "the option 'netapp_pool_name_search_pattern' instead.") versionutils.report_deprecated_feature(LOG, msg) pool_regex = na_utils.get_pool_name_filter_regex(self.configuration) filtered_pools = [] for vol in self.vols: vol_name = vol.get_child_content('name') if pool_regex.match(vol_name): msg = ("Volume '%(vol_name)s' matches against regular " "expression: %(vol_pattern)s") LOG.debug(msg, {'vol_name': vol_name, 'vol_pattern': pool_regex.pattern}) filtered_pools.append(vol_name) else: msg = ("Volume '%(vol_name)s' does not match against regular " "expression: %(vol_pattern)s") LOG.debug(msg, {'vol_name': vol_name, 'vol_pattern': pool_regex.pattern}) return filtered_pools
def _normalize_domain_id(cls, ref): """Fill in domain_id if not specified in a v3 call.""" if not ref.get('domain_id'): oslo_ctx = flask.request.environ.get(context.REQUEST_CONTEXT_ENV, None) if oslo_ctx and oslo_ctx.domain_id: # Domain Scoped Token Scenario. ref['domain_id'] = oslo_ctx.domain_id elif oslo_ctx.is_admin: # Legacy "shared" admin token Scenario raise exception.ValidationError( _('You have tried to create a resource using the admin ' 'token. As this token is not within a domain you must ' 'explicitly include a domain for this resource to ' 'belong to.')) else: # TODO(henry-nash): We should issue an exception here since if # a v3 call does not explicitly specify the domain_id in the # entity, it should be using a domain scoped token. However, # the current tempest heat tests issue a v3 call without this. # This is raised as bug #1283539. Once this is fixed, we # should remove the line below and replace it with an error. # # Ahead of actually changing the code to raise an exception, we # issue a deprecation warning. versionutils.report_deprecated_feature( LOG, 'Not specifying a domain during a create user, group or ' 'project call, and relying on falling back to the ' 'default domain, is deprecated as of Liberty. There is no ' 'plan to remove this compatibility, however, future API ' 'versions may remove this, so please specify the domain ' 'explicitly or use a domain-scoped token.') ref['domain_id'] = CONF.identity.default_domain_id return ref
def _get_domain_id_from_token(self, context): """Get the domain_id for a v3 create call. In the case of a v3 create entity call that does not specify a domain ID, the spec says that we should use the domain scoping from the token being used. """ token_ref = utils.get_token_ref(context) if token_ref.domain_scoped: return token_ref.domain_id else: # TODO(henry-nash): We should issue an exception here since if # a v3 call does not explicitly specify the domain_id in the # entity, it should be using a domain scoped token. However, # the current tempest heat tests issue a v3 call without this. # This is raised as bug #1283539. Once this is fixed, we # should remove the line below and replace it with an error. # # Ahead of actually changing the code to raise an exception, we # issue a deprecation warning. versionutils.report_deprecated_feature( LOG, _LW('Not specifying a domain during a create user, group or ' 'project call, and relying on falling back to the ' 'default domain, is deprecated as of Liberty and will be ' 'removed in the N release. Specify the domain explicitly ' 'or use a domain-scoped token')) return CONF.identity.default_domain_id
def plug(self, network_id, port_id, device_name, mac_address, bridge=None, namespace=None, prefix=None, mtu=None): if not ip_lib.device_exists(device_name, namespace=namespace): try: self.plug_new(network_id, port_id, device_name, mac_address, bridge, namespace, prefix, mtu) except TypeError: versionutils.report_deprecated_feature( LOG, _LW('Interface driver does not support MTU parameter. ' 'This may not work in future releases.')) self.plug_new(network_id, port_id, device_name, mac_address, bridge, namespace, prefix) else: LOG.info(_LI("Device %s already exists"), device_name) if mtu: self.set_mtu(device_name, mtu, namespace=namespace, prefix=prefix) else: LOG.warning(_LW("No MTU configured for port %s"), port_id)
def __init__(self, application): super(CrudExtension, self).__init__(application) msg = _("Remove admin_crud_extension from the paste pipeline, the " "admin_crud extension is now always available. Update" "the [pipeline:admin_api] section in keystone-paste.ini " "accordingly, as it will be removed in the O release.") versionutils.report_deprecated_feature(LOG, msg)
def main(): objects.register_all() gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project="cinder", version=version.version_string()) config.set_middleware_defaults() logging.setup(CONF, "cinder") LOG = logging.getLogger("cinder.all") versionutils.report_deprecated_feature(LOG, _("cinder-all is deprecated in Newton and will be removed in Ocata.")) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) launcher = service.process_launcher() # cinder-api try: server = service.WSGIService("osapi_volume") launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE("Failed to load osapi_volume")) for binary in ["cinder-scheduler", "cinder-backup"]: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE("Failed to load %s"), binary) # cinder-volume try: if CONF.enabled_backends: for backend in CONF.enabled_backends: CONF.register_opt(volume_cmd.host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) server = service.Service.create( host=host, service_name=backend, binary="cinder-volume", coordination=True ) # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases # where child processes share DB connections which results # in errors. session.dispose_engine() launcher.launch_service(server) else: LOG.warning( _LW( "Configuration for cinder-volume does not specify " '"enabled_backends", using DEFAULT as backend. ' "Support for DEFAULT section to configure drivers " "will be removed in the next release." ) ) server = service.Service.create(binary="cinder-volume", coordination=True) launcher.launch_service(server) except (Exception, SystemExit): LOG.exception(_LE("Failed to load cinder-volume")) launcher.wait()
def _normalize_domain_id(cls, ref): """Fill in domain_id if not specified in a v3 call.""" if not ref.get('domain_id'): oslo_ctx = flask.request.environ.get( context.REQUEST_CONTEXT_ENV, None) if oslo_ctx and oslo_ctx.domain_id: # Domain Scoped Token Scenario. ref['domain_id'] = oslo_ctx.domain_id elif oslo_ctx.is_admin: # Legacy "shared" admin token Scenario raise exception.ValidationError( _('You have tried to create a resource using the admin ' 'token. As this token is not within a domain you must ' 'explicitly include a domain for this resource to ' 'belong to.')) else: # TODO(henry-nash): We should issue an exception here since if # a v3 call does not explicitly specify the domain_id in the # entity, it should be using a domain scoped token. However, # the current tempest heat tests issue a v3 call without this. # This is raised as bug #1283539. Once this is fixed, we # should remove the line below and replace it with an error. # # Ahead of actually changing the code to raise an exception, we # issue a deprecation warning. versionutils.report_deprecated_feature( LOG, 'Not specifying a domain during a create user, group or ' 'project call, and relying on falling back to the ' 'default domain, is deprecated as of Liberty. There is no ' 'plan to remove this compatibility, however, future API ' 'versions may remove this, so please specify the domain ' 'explicitly or use a domain-scoped token.') ref['domain_id'] = CONF.identity.default_domain_id return ref
def pipeline_factory(loader, global_conf, **local_conf): """A paste pipeline replica that keys off of auth_strategy.""" versionutils.report_deprecated_feature( LOG, _LW("The legacy V2 API code tree has been removed in Newton. " "Please remove legacy v2 API entry from api-paste.ini, and use " "V2.1 API or V2.1 API compat mode instead"))
def deprecation_warning(): versionutils.report_deprecated_feature( LOG, _LW('httpd/keystone.py is deprecated as of Mitaka' ' in favor of keystone-wsgi-admin and keystone-wsgi-public' ' and may be removed in O.') )
def get_driver(self): if self._driver is None: _driver_class = self._driver_class or cfg.CONF.QUOTAS.quota_driver if _driver_class == QUOTA_DB_DRIVER and QUOTA_DB_MODULE not in sys.modules: # If quotas table is not loaded, force config quota driver. _driver_class = QUOTA_CONF_DRIVER LOG.info( _LI( "ConfDriver is used as quota_driver because the " "loaded plugin does not support 'quotas' table." ) ) if isinstance(_driver_class, six.string_types): _driver_class = importutils.import_object(_driver_class) if isinstance(_driver_class, ConfDriver): versionutils.report_deprecated_feature( LOG, _LW( "The quota driver neutron.quota.ConfDriver is " "deprecated as of Liberty. " "neutron.db.quota.driver.DbQuotaDriver should " "be used in its place" ), ) self._driver = _driver_class LOG.info(_LI("Loaded quota_driver: %s."), _driver_class) return self._driver
def __init__(self): versionutils.report_deprecated_feature( LOG, _LW('The in tree EC2 API has been removed in Mitaka. ' 'Please remove entries from api-paste.ini and use ' 'the OpenStack ec2-api project ' 'http://git.openstack.org/cgit/openstack/ec2-api/'))
def index(self, req): """Return a list of all running services. Filter by host & service name. """ context = req.environ['cinder.context'] authorize(context, action='index') detailed = self.ext_mgr.is_loaded('os-extended-services') now = timeutils.utcnow(with_timezone=True) services = objects.ServiceList.get_all(context) host = '' if 'host' in req.GET: host = req.GET['host'] service = '' if 'service' in req.GET: service = req.GET['service'] versionutils.report_deprecated_feature( LOG, _("Query by service parameter is deprecated. " "Please use binary parameter instead.")) binary = '' if 'binary' in req.GET: binary = req.GET['binary'] if host: services = [s for s in services if s.host == host] # NOTE(uni): deprecating service request key, binary takes precedence binary_key = binary or service if binary_key: services = [s for s in services if s.binary == binary_key] svcs = [] for svc in services: updated_at = svc.updated_at delta = now - (svc.updated_at or svc.created_at) delta_sec = delta.total_seconds() if svc.modified_at: delta_mod = now - svc.modified_at if abs(delta_sec) >= abs(delta_mod.total_seconds()): updated_at = svc.modified_at alive = abs(delta_sec) <= CONF.service_down_time art = (alive and "up") or "down" active = 'enabled' if svc.disabled: active = 'disabled' if updated_at: updated_at = timeutils.normalize_time(updated_at) ret_fields = { 'binary': svc.binary, 'host': svc.host, 'zone': svc.availability_zone, 'status': active, 'state': art, 'updated_at': updated_at } if detailed: ret_fields['disabled_reason'] = svc.disabled_reason svcs.append(ret_fields) return {'services': svcs}
def _get_defaults(context, config_defaults): """Get default quota values. If the default class is defined, use the values defined in the class, otherwise use the values from the config. :param context: :param config_defaults: :return: """ quotas = {} default_quotas = {} if CONF.use_default_quota_class: default_quotas = db_api.quota_class_get_default(context) for resource, default in six.iteritems(config_defaults): # get rid of the 'quota_' prefix resource_name = resource[6:] if default_quotas: if resource_name not in default_quotas: versionutils.report_deprecated_feature(LOG, _( "Default quota for resource: %(res)s is set " "by the default quota flag: quota_%(res)s, " "it is now deprecated. Please use the " "default quota class for default " "quota.") % {'res': resource_name}) quotas[resource_name] = default_quotas.get(resource_name, default) return quotas
def delete(self, req, id, body): """Delete a consistency group.""" versionutils.report_deprecated_feature(LOG, DEPRECATE_CG_API_MSG) LOG.debug('delete called for member %s', id) context = req.environ['cinder.context'] force = False if body: self.assert_valid_body(body, 'consistencygroup') cg_body = body['consistencygroup'] try: force = strutils.bool_from_string(cg_body.get('force', False), strict=True) except ValueError: msg = _("Invalid value '%s' for force.") % force raise exc.HTTPBadRequest(explanation=msg) LOG.info('Delete consistency group with id: %s', id) try: group = self._get(context, id) context.authorize(gp_action_policy.DELETE_POLICY, target_obj=group) self.group_api.delete(context, group, force) # Not found exception will be handled at the wsgi level except exception.InvalidConsistencyGroup as error: raise exc.HTTPBadRequest(explanation=error.msg) return webob.Response(status_int=HTTPStatus.ACCEPTED)
def setUp(self): super(DeprecatedDecorators, self).setUp() # The only reason this is here is because report_deprecated_feature() # registers the fatal_deprecations option which these tests use. versionutils.report_deprecated_feature(log.getLogger(__name__), 'ignore this message')
def main(): log.register_options(CONF) config.set_middleware_defaults() CONF(sys.argv[1:], project='manila', version=version.version_string()) log.setup(CONF, "manila") LOG = log.getLogger('manila.all') msg = _('manila-all is deprecated in Newton and ' 'will be removed in Ocata.') versionutils.report_deprecated_feature(LOG, msg) utils.monkey_patch() launcher = service.process_launcher() # manila-api try: server = service.WSGIService('osapi_share') launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE('Failed to load osapi_share')) for binary in ['manila-share', 'manila-scheduler', 'manila-api', 'manila-data']: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), binary) launcher.wait()
def __init__(self, *args, **kwargs): msg = _("The Hitachi NAS driver is deprecated and will be " "removed in a future release.") versionutils.report_deprecated_feature(LOG, msg) self._execute = None self.context = None self.configuration = kwargs.get('configuration', None) service_parameters = ['volume_type', 'hdp'] optional_parameters = ['ssc_cmd', 'cluster_admin_ip0'] if self.configuration: self.configuration.append_config_values( hnas_utils.drivers_common_opts) self.configuration.append_config_values(NFS_OPTS) self.config = {} # Trying to get HNAS configuration from cinder.conf self.config = hnas_utils.read_cinder_conf( self.configuration) # If HNAS configuration are not set on cinder.conf, tries to use # the deprecated XML configuration file if not self.config: self.config = hnas_utils.read_xml_config( self.configuration.hds_hnas_nfs_config_file, service_parameters, optional_parameters) super(HNASNFSDriver, self).__init__(*args, **kwargs) self.backend = hnas_backend.HNASSSHBackend(self.config)
def _enable_netfilter_for_bridges(self): # we only need to set these values once, but it has to be when # we create a bridge; before that the bridge module might not # be loaded and the proc values aren't there. if self._enabled_netfilter_for_bridges: return else: self._enabled_netfilter_for_bridges = True # These proc values ensure that netfilter is enabled on # bridges; essential for enforcing security groups rules with # OVS Hybrid. Distributions can differ on whether this is # enabled by default or not (Ubuntu - yes, Redhat - no, for # example). LOG.debug("Enabling netfilter for bridges") entries = utils.execute(['sysctl', '-N', 'net.bridge'], run_as_root=True).splitlines() for proto in ('arp', 'ip', 'ip6'): knob = 'net.bridge.bridge-nf-call-%stables' % proto if 'net.bridge.bridge-nf-call-%stables' % proto not in entries: raise SystemExit( _("sysctl value %s not present on this system.") % knob) enabled = utils.execute(['sysctl', '-b', knob]) if enabled != '1': versionutils.report_deprecated_feature( LOG, _LW('Bridge firewalling is disabled; enabling to make ' 'iptables firewall work. This may not work in future ' 'releases.')) utils.execute( ['sysctl', '-w', '%s=1' % knob], run_as_root=True)
def service_providers(self): """Return the service providers for the extension module.""" providers = [] # Attempt to read the config from cfg.CONF first; when passing # --config-dir, the option is merged from all the definitions # made across all the imported config files try: providers = cfg.CONF.service_providers.service_provider except cfg.NoSuchOptError: pass # Alternatively, if the option is not available, try to load # it from the provider module's config file; this may be # necessary, if modules are loaded on the fly (DevStack may # be an example) if not providers: providers = self.ini().service_providers.service_provider if providers: versionutils.report_deprecated_feature( LOG, _LW('Implicit loading of service providers from ' 'neutron_*.conf files is deprecated and will be ' 'removed in Ocata release.')) return providers
def load_auth_method(method): plugin_name = CONF.auth.get(method) or 'default' namespace = 'keystone.auth.%s' % method try: driver_manager = stevedore.DriverManager(namespace, plugin_name, invoke_on_load=True) return driver_manager.driver except RuntimeError: LOG.debug( 'Failed to load the %s driver (%s) using stevedore, will ' 'attempt to load using import_object instead.', method, plugin_name) driver = importutils.import_object(plugin_name) msg = (_( 'Direct import of auth plugin %(name)r is deprecated as of Liberty in ' 'favor of its entrypoint from %(namespace)r and may be removed in ' 'N.') % { 'name': plugin_name, 'namespace': namespace }) versionutils.report_deprecated_feature(LOG, msg) return driver
def __init__(self, *args, **kwargs): msg = _("The Hitachi NAS driver is deprecated and will be " "removed in a future release.") versionutils.report_deprecated_feature(LOG, msg) self._execute = None self.context = None self.configuration = kwargs.get('configuration', None) service_parameters = ['volume_type', 'hdp'] optional_parameters = ['ssc_cmd', 'cluster_admin_ip0'] if self.configuration: self.configuration.append_config_values( hnas_utils.drivers_common_opts) self.configuration.append_config_values(NFS_OPTS) self.config = {} # Trying to get HNAS configuration from cinder.conf self.config = hnas_utils.read_cinder_conf(self.configuration) # If HNAS configuration are not set on cinder.conf, tries to use # the deprecated XML configuration file if not self.config: self.config = hnas_utils.read_xml_config( self.configuration.hds_hnas_nfs_config_file, service_parameters, optional_parameters) super(HNASNFSDriver, self).__init__(*args, **kwargs) self.backend = hnas_backend.HNASSSHBackend(self.config)
def do_setup(self, context): super(NetAppBlockStorage7modeLibrary, self).do_setup(context) self.volume_list = [] self.vfiler = self.configuration.netapp_vfiler self.zapi_client = client_7mode.Client( self.volume_list, transport_type=self.configuration.netapp_transport_type, username=self.configuration.netapp_login, password=self.configuration.netapp_password, hostname=self.configuration.netapp_server_hostname, port=self.configuration.netapp_server_port, vfiler=self.vfiler) self._do_partner_setup() self.vol_refresh_time = None self.vol_refresh_interval = 1800 self.vol_refresh_running = False self.vol_refresh_voluntary = False self.root_volume_name = self._get_root_volume_name() self.perf_library = perf_7mode.Performance7modeLibrary( self.zapi_client) # This driver has been marked 'deprecated' in the Ocata release and # can be removed in Queens. msg = _("The 7-mode Data ONTAP driver is deprecated and will be " "removed in a future release.") versionutils.report_deprecated_feature(LOG, msg)
def auto_schedule_routers(self, plugin, context, host, router_ids=None): """Schedule under-scheduled routers to L3 Agents. An under-scheduled router is a router that is either completely un-scheduled (scheduled to 0 agents), or an HA router that is under-scheduled (scheduled to less than max_l3_agents configuration option. The function finds all the under-scheduled routers and schedules them. :param host: if unspecified, under-scheduled routers are scheduled to all agents (not necessarily from the requesting host). If specified, under-scheduled routers are scheduled only to the agent on 'host'. :param router_ids: currently unused and deprecated. kept for backward compatibility. """ if router_ids is not None: versionutils.report_deprecated_feature( LOG, 'Passing router_ids has no effect on L3 agent ' 'scheduling. This is deprecated and will be ' 'removed in the Queens release.') l3_agent = plugin.get_enabled_agent_on_host( context, lib_const.AGENT_TYPE_L3, host) if not l3_agent: return underscheduled_routers = self._get_underscheduled_routers( plugin, context) target_routers = self._get_routers_can_schedule( plugin, context, underscheduled_routers, l3_agent) for router in target_routers: self.schedule(plugin, context, router['id'], candidates=[l3_agent])
def _build_token_auth_context(self, request, token_id): if CONF.admin_token and token_id == CONF.admin_token: versionutils.report_deprecated_feature( LOG, _LW('build_auth_context middleware checking for the admin ' 'token is deprecated as of the Mitaka release and will be ' 'removed in the O release. If your deployment requires ' 'use of the admin token, update keystone-paste.ini so ' 'that admin_token_auth is before build_auth_context in ' 'the paste pipelines, otherwise remove the ' 'admin_token_auth middleware from the paste pipelines.')) return {}, True context = {'token_id': token_id} context['environment'] = request.environ try: token_ref = token_model.KeystoneToken( token_id=token_id, token_data=self.token_provider_api.validate_token(token_id)) # TODO(gyee): validate_token_bind should really be its own # middleware wsgi.validate_token_bind(context, token_ref) return authorization.token_to_auth_context(token_ref), False except exception.TokenNotFound: LOG.warning(_LW('RBAC: Invalid token')) raise exception.Unauthorized()
def build_server_config(self, network, subnet, port, tags, default_dns_nameservers=None, default_dns_domain=None): versionutils.report_deprecated_feature( LOG, 'NsxLibQosNativeDhcp.build_server_config is deprecated. ' 'Please use build_server instead') # Prepare the configuration for a new logical DHCP server. server_ip = "%s/%u" % (port['fixed_ips'][0]['ip_address'], netaddr.IPNetwork(subnet['cidr']).prefixlen) dns_nameservers = subnet['dns_nameservers'] if not dns_nameservers or not utils.is_attr_set(dns_nameservers): # use the default one , or the globally configured one if default_dns_nameservers is not None: dns_nameservers = default_dns_nameservers else: dns_nameservers = self.nsxlib_config.dns_nameservers gateway_ip = subnet['gateway_ip'] if not utils.is_attr_set(gateway_ip): gateway_ip = None static_routes, gateway_ip = self.build_static_routes( gateway_ip, subnet['cidr'], subnet['host_routes']) options = {'option121': {'static_routes': static_routes}} name = self.build_server_name(network['name'], network['id']) domain_name = self.build_server_domain_name(network.get('dns_domain'), default_dns_domain) return {'name': name, 'server_ip': server_ip, 'dns_nameservers': dns_nameservers, 'domain_name': domain_name, 'gateway_ip': gateway_ip, 'options': options, 'tags': tags}
def get_defaults(self, context, resources, parent_project_id=None): """Given a list of resources, retrieve the default quotas. Use the class quotas named `_DEFAULT_QUOTA_NAME` as default quotas, if it exists. :param context: The request context, for access checks. :param resources: A dictionary of the registered resources. :param parent_project_id: The id of the current project's parent, if any. """ quotas = {} default_quotas = {} if CONF.use_default_quota_class: default_quotas = db.quota_class_get_default(context) for resource in resources.values(): if resource.name not in default_quotas: versionutils.report_deprecated_feature(LOG, _( "Default quota for resource: %(res)s is set " "by the default quota flag: quota_%(res)s, " "it is now deprecated. Please use the " "default quota class for default " "quota.") % {'res': resource.name}) quotas[resource.name] = default_quotas.get(resource.name, (0 if parent_project_id else resource.default)) return quotas
def main(): log.register_options(CONF) config.set_middleware_defaults() CONF(sys.argv[1:], project='manila', version=version.version_string()) log.setup(CONF, "manila") LOG = log.getLogger('manila.all') msg = _('manila-all is deprecated in Newton and ' 'will be removed in Ocata.') versionutils.report_deprecated_feature(LOG, msg) utils.monkey_patch() launcher = service.process_launcher() # manila-api try: server = service.WSGIService('osapi_share') launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE('Failed to load osapi_share')) for binary in [ 'manila-share', 'manila-scheduler', 'manila-api', 'manila-data' ]: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), binary) launcher.wait()
def __init__(self, *args, **kwargs): super(OAuth1Extension, self).__init__(*args, **kwargs) msg = _("Remove oauth1_extension from the paste pipeline, the " "oauth1 extension is now always available. Update the " "[pipeline:api_v3] section in keystone-paste.ini accordingly, " "as it will be removed in the O release.") versionutils.report_deprecated_feature(LOG, msg)
def _get_filtered_pools(self): """Return available pools filtered by a pool name search pattern.""" # Inform deprecation of legacy option. if self.configuration.safe_get('netapp_volume_list'): msg = _LW("The option 'netapp_volume_list' is deprecated and " "will be removed in the future releases. Please use " "the option 'netapp_pool_name_search_pattern' instead.") versionutils.report_deprecated_feature(LOG, msg) pool_regex = na_utils.get_pool_name_filter_regex(self.configuration) filtered_pools = [] for vol in self.vols: vol_name = vol.get_child_content('name') if pool_regex.match(vol_name): msg = ("Volume '%(vol_name)s' matches against regular " "expression: %(vol_pattern)s") LOG.debug(msg, { 'vol_name': vol_name, 'vol_pattern': pool_regex.pattern }) filtered_pools.append(vol_name) else: msg = ("Volume '%(vol_name)s' does not match against regular " "expression: %(vol_pattern)s") LOG.debug(msg, { 'vol_name': vol_name, 'vol_pattern': pool_regex.pattern }) return filtered_pools
def __init__(self): self.api = volume_api.HostAPI() super(HostController, self).__init__() versionutils.report_deprecated_feature( LOG, "The Host API is deprecated and will be " "be removed in a future version.")
def auto_schedule_routers(self, plugin, context, host, router_ids=None): """Schedule under-scheduled routers to L3 Agents. An under-scheduled router is a router that is either completely un-scheduled (scheduled to 0 agents), or an HA router that is under-scheduled (scheduled to less than max_l3_agents configuration option. The function finds all the under-scheduled routers and schedules them. :param host: if unspecified, under-scheduled routers are scheduled to all agents (not necessarily from the requesting host). If specified, under-scheduled routers are scheduled only to the agent on 'host'. :param router_ids: currently unused and deprecated. kept for backward compatibility. """ if router_ids is not None: versionutils.report_deprecated_feature( LOG, 'Passing router_ids has no effect on L3 agent ' 'scheduling. This is deprecated and will be ' 'removed in the Queens release.') l3_agent = plugin.get_enabled_agent_on_host(context, lib_const.AGENT_TYPE_L3, host) if not l3_agent: return underscheduled_routers = self._get_underscheduled_routers( plugin, context) target_routers = self._get_routers_can_schedule( plugin, context, underscheduled_routers, l3_agent) for router in target_routers: self.schedule(plugin, context, router['id'], candidates=[l3_agent])
def delete(self, req, id, body): """Delete a consistency group.""" versionutils.report_deprecated_feature(LOG, DEPRECATE_CG_API_MSG) LOG.debug('delete called for member %s', id) context = req.environ['cinder.context'] force = False if body: self.assert_valid_body(body, 'consistencygroup') cg_body = body['consistencygroup'] try: force = strutils.bool_from_string(cg_body.get('force', False), strict=True) except ValueError: msg = _("Invalid value '%s' for force.") % force raise exc.HTTPBadRequest(explanation=msg) LOG.info('Delete consistency group with id: %s', id) try: group = self._get(context, id) context.authorize(gp_action_policy.DELETE_POLICY, target_obj=group) self.group_api.delete(context, group, force) # Not found exception will be handled at the wsgi level except exception.InvalidConsistencyGroup as error: raise exc.HTTPBadRequest(explanation=error.msg) return webob.Response(status_int=http_client.ACCEPTED)
def setUp(self): super(DeprecatedDecorators, self).setUp() # The only reason this is here is because report_deprecated_feature() # registers the fatal_deprecations option which these tests use. versionutils.report_deprecated_feature( log.getLogger(__name__), 'ignore this message')
def update_shaping(self, profile_id, shaping_enabled=False, burst_size=None, peak_bandwidth=None, average_bandwidth=None, qos_marking=None, dscp=None, direction=nsx_constants.INGRESS): versionutils.report_deprecated_feature( LOG, 'NsxLibQosSwitchingProfile.update_shaping is deprecated. ' 'Please use set_profile_shaping instead.') # get the current configuration body = self.get(profile_id) # update the relevant fields if shaping_enabled: body = self._enable_shaping_in_args( body, burst_size=burst_size, peak_bandwidth=peak_bandwidth, average_bandwidth=average_bandwidth, direction=direction) else: body = self._disable_shaping_in_args(body, direction=direction) body = self._update_dscp_in_args(body, qos_marking, dscp) return self._update_with_retry(profile_id, body)
def __init__(self, *args, **kwargs): super(DellEQLSanISCSIDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(eqlx_opts) self._group_ip = None self.sshpool = None if self.configuration.eqlx_use_chap is True: LOG.warning(_LW( 'Configuration options eqlx_use_chap, ' 'eqlx_chap_login and eqlx_chap_password are deprecated. Use ' 'use_chap_auth, chap_username and chap_password ' 'respectively for the same.')) self.configuration.use_chap_auth = ( self.configuration.eqlx_use_chap) self.configuration.chap_username = ( self.configuration.eqlx_chap_login) self.configuration.chap_password = ( self.configuration.eqlx_chap_password) if self.configuration.eqlx_cli_timeout: msg = _LW('Configuration option eqlx_cli_timeout ' 'is deprecated and will be removed in M release. ' 'Use ssh_conn_timeout instead.') self.configuration.ssh_conn_timeout = ( self.configuration.eqlx_cli_timeout) versionutils.report_deprecated_feature(LOG, msg)
def update_group(self, group_id, group): msg = _DEPRECATION_MSG % "update_group" versionutils.report_deprecated_feature(LOG, msg) self.group.check_allow_update() if 'name' in group: group['name'] = clean.group_name(group['name']) return common_ldap.filter_entity(self.group.update(group_id, group))
def __init__(self, *args, **kwargs): super(DellEQLSanISCSIDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(eqlx_opts) self._group_ip = None self.sshpool = None if self.configuration.eqlx_use_chap is True: LOG.warning( _LW('Configuration options eqlx_use_chap, ' 'eqlx_chap_login and eqlx_chap_password are deprecated. Use ' 'use_chap_auth, chap_username and chap_password ' 'respectively for the same.')) self.configuration.use_chap_auth = ( self.configuration.eqlx_use_chap) self.configuration.chap_username = ( self.configuration.eqlx_chap_login) self.configuration.chap_password = ( self.configuration.eqlx_chap_password) if self.configuration.eqlx_cli_timeout: msg = _LW('Configuration option eqlx_cli_timeout ' 'is deprecated and will be removed in M release. ' 'Use ssh_conn_timeout instead.') self.configuration.ssh_conn_timeout = ( self.configuration.eqlx_cli_timeout) versionutils.report_deprecated_feature(LOG, msg)
def service_providers(self): """Return the service providers for the extension module.""" providers = [] # Attempt to read the config from cfg.CONF first; when passing # --config-dir, the option is merged from all the definitions # made across all the imported config files try: providers = cfg.CONF.service_providers.service_provider except cfg.NoSuchOptError: pass # Alternatively, if the option is not available, try to load # it from the provider module's config file; this may be # necessary, if modules are loaded on the fly (DevStack may # be an example) if not providers: providers = self.ini().service_providers.service_provider if providers: versionutils.report_deprecated_feature( LOG, 'Implicit loading of service providers from ' 'neutron_*.conf files is deprecated and will be ' 'removed in Ocata release.') return providers
def do_setup(self, context): # If any of the deprecated options are set, we'll warn the operator to # use the new authentication method. DEPRECATED_OPTS = [ self.configuration.driver_client_cert_key, self.configuration.driver_client_cert, self.configuration.datera_api_token ] if any(DEPRECATED_OPTS): msg = _LW("Client cert verification and datera_api_token are " "deprecated in the Datera driver, and will be removed " "in the Liberty release. Please set the san_login and " "san_password in your cinder.conf instead.") versionutils.report_deprecated_feature(LOG, msg) return # If we can't authenticate through the old and new method, just fail # now. if not all([self.username, self.password]): msg = _("san_login and/or san_password is not set for Datera " "driver in the cinder.conf. Set this information and " "start the cinder-volume service again.") LOG.error(msg) raise exception.InvalidInput(msg) self._login()
def pipeline_factory(loader, global_conf, **local_conf): """A paste pipeline replica that keys off of auth_strategy.""" versionutils.report_deprecated_feature( LOG, _LW("The legacy V2 API code tree has been removed in Newton. " "Please remove legacy v2 API entry from api-paste.ini, and use " "V2.1 API or V2.1 API compat mode instead") )
def __init__(self): versionutils.report_deprecated_feature( LOG, 'The in tree EC2 API has been removed in Mitaka. ' 'Please remove entries from api-paste.ini and use ' 'the OpenStack ec2-api project ' 'http://git.openstack.org/cgit/openstack/ec2-api/' )
def __init__(self, nsx_api_managers=None, username=None, password=None, client_cert_provider=None, insecure=True, ca_file=None, concurrent_connections=10, retries=3, http_timeout=10, http_read_timeout=180, conn_idle_timeout=10, http_provider=None, max_attempts=10, plugin_scope=None, plugin_tag=None, plugin_ver=None, dns_nameservers=None, dns_domain='openstacklocal', dhcp_profile_uuid=None, allow_overwrite_header=False, rate_limit_retry=True, cluster_unavailable_retry=False, allow_passthrough=False, realization_max_attempts=50, realization_wait_sec=1.0): self.nsx_api_managers = nsx_api_managers self._username = username self._password = password self._ca_file = ca_file self.insecure = insecure self.concurrent_connections = concurrent_connections self.retries = retries self.http_timeout = http_timeout self.http_read_timeout = http_read_timeout self.conn_idle_timeout = conn_idle_timeout self.http_provider = http_provider self.client_cert_provider = client_cert_provider self.max_attempts = max_attempts self.plugin_scope = plugin_scope self.plugin_tag = plugin_tag self.plugin_ver = plugin_ver self.dns_nameservers = dns_nameservers or [] self.dns_domain = dns_domain self.allow_overwrite_header = allow_overwrite_header self.rate_limit_retry = rate_limit_retry self.cluster_unavailable_retry = cluster_unavailable_retry self.allow_passthrough = allow_passthrough self.realization_max_attempts = realization_max_attempts self.realization_wait_sec = realization_wait_sec if dhcp_profile_uuid: # this is deprecated, and never used. versionutils.report_deprecated_feature( LOG, 'dhcp_profile_uuid is not used by the nsxlib, and will ' 'be removed from its configuration in the future.')
def do_setup(self, context): """Any initialization the volume driver does while starting.""" super(DrbdManageBaseDriver, self).do_setup(context) msg = _("The DRBD Manage driver is moving to maintenance mode " "in the Stein release and will be removed in T release.") versionutils.report_deprecated_feature(LOG, msg) self.dbus_connect()