def pipeline_factory(loader, global_conf, **local_conf): """A paste pipeline replica that keys off of auth_strategy.""" # TODO(sdague): remove deprecated noauth in Liberty if CONF.auth_strategy == 'noauth': versionutils.report_deprecated_feature( LOG, ('The noauth middleware will be removed in Liberty.' ' noauth2 should be used instead.')) pipeline = local_conf[CONF.auth_strategy] if not CONF.api_rate_limit: limit_name = CONF.auth_strategy + '_nolimit' pipeline = local_conf.get(limit_name, pipeline) pipeline = pipeline.split() return _load_pipeline(loader, pipeline)
def __init__(self, root_directory, bucket_depth=0, mapper=None): versionutils.report_deprecated_feature( LOG, _LW('The in tree EC2 API is deprecated as of Kilo release and may ' 'be removed in a future release. The stackforge ec2-api ' 'project http://git.openstack.org/cgit/stackforge/ec2-api/ ' 'is the target replacement for this functionality.') ) if mapper is None: mapper = routes.Mapper() mapper.connect('/', controller=lambda *a, **kw: RootHandler(self)(*a, **kw)) mapper.connect('/{bucket}/{object_name}', controller=lambda *a, **kw: ObjectHandler(self)(*a, **kw)) mapper.connect('/{bucket_name}/', controller=lambda *a, **kw: BucketHandler(self)(*a, **kw)) self.directory = os.path.abspath(root_directory) fileutils.ensure_tree(self.directory) self.bucket_depth = bucket_depth super(S3Application, self).__init__(mapper)
def __init__(self, root_directory, bucket_depth=0, mapper=None): versionutils.report_deprecated_feature( LOG, _LW('The in tree EC2 API is deprecated as of Kilo release and may ' 'be removed in a future release. The stackforge ec2-api ' 'project http://git.openstack.org/cgit/stackforge/ec2-api/ ' 'is the target replacement for this functionality.')) if mapper is None: mapper = routes.Mapper() mapper.connect('/', controller=lambda *a, **kw: RootHandler(self)(*a, **kw)) mapper.connect('/{bucket}/{object_name}', controller=lambda *a, **kw: ObjectHandler(self) (*a, **kw)) mapper.connect('/{bucket_name}/', controller=lambda *a, **kw: BucketHandler(self) (*a, **kw)) self.directory = os.path.abspath(root_directory) fileutils.ensure_tree(self.directory) self.bucket_depth = bucket_depth super(S3Application, self).__init__(mapper)
def __init__(self, virtapi, scheme="https"): super(VMwareVCDriver, self).__init__(virtapi) if (CONF.vmware.host_ip is None or CONF.vmware.host_username is None or CONF.vmware.host_password is None): raise Exception( _("Must specify host_ip, host_username and " "host_password to use vmwareapi.VMwareVCDriver")) self._datastore_regex = None if CONF.vmware.datastore_regex: try: self._datastore_regex = re.compile(CONF.vmware.datastore_regex) except re.error: raise exception.InvalidInput( reason=_("Invalid Regular Expression %s") % CONF.vmware.datastore_regex) self._session = VMwareAPISession(scheme=scheme) self._check_min_version() # Update the PBM location if necessary if CONF.vmware.pbm_enabled: self._update_pbm_location() self._validate_configuration() # Get the list of clusters to be used self._cluster_names = CONF.vmware.cluster_name if len(self._cluster_names) > 1: versionutils.report_deprecated_feature( LOG, _LW('The "cluster_name" setting should have only one ' 'cluster name. The capability of allowing ' 'multiple clusters may be dropped in the ' 'Liberty release.')) self.dict_mors = vm_util.get_all_cluster_refs_by_name( self._session, self._cluster_names) if not self.dict_mors: raise exception.NotFound( _("All clusters specified %s were not" " found in the vCenter") % self._cluster_names) # Check if there are any clusters that were specified in the nova.conf # but are not in the vCenter, for missing clusters log a warning. clusters_found = [ v.get('name') for k, v in six.iteritems(self.dict_mors) ] missing_clusters = set(self._cluster_names) - set(clusters_found) if missing_clusters: LOG.warning( _LW("The following clusters could not be found in the " "vCenter %s"), list(missing_clusters)) self._vcenter_uuid = self._get_vcenter_uuid() # The _resources is used to maintain the vmops, volumeops and vcstate # objects per cluster self._resources = {} self._resource_keys = set() self._virtapi = virtapi self._update_resources() # The following initialization is necessary since the base class does # not use VC state. first_cluster = self._resources.keys()[0] self._vmops = self._resources.get(first_cluster).get('vmops') self._volumeops = self._resources.get(first_cluster).get('volumeops') self._vc_state = self._resources.get(first_cluster).get('vcstate') # Register the OpenStack extension self._register_openstack_extension()
def __init__(self, virtapi, scheme="https"): super(VMwareVCDriver, self).__init__(virtapi) if (CONF.vmware.host_ip is None or CONF.vmware.host_username is None or CONF.vmware.host_password is None): raise Exception(_("Must specify host_ip, host_username and " "host_password to use vmwareapi.VMwareVCDriver")) self._datastore_regex = None if CONF.vmware.datastore_regex: try: self._datastore_regex = re.compile(CONF.vmware.datastore_regex) except re.error: raise exception.InvalidInput(reason= _("Invalid Regular Expression %s") % CONF.vmware.datastore_regex) self._session = VMwareAPISession(scheme=scheme) self._check_min_version() # Update the PBM location if necessary if CONF.vmware.pbm_enabled: self._update_pbm_location() self._validate_configuration() # Get the list of clusters to be used self._cluster_names = CONF.vmware.cluster_name if len(self._cluster_names) > 1: versionutils.report_deprecated_feature( LOG, _LW('The "cluster_name" setting should have only one ' 'cluster name. The capability of allowing ' 'multiple clusters may be dropped in the ' 'Liberty release.')) self.dict_mors = vm_util.get_all_cluster_refs_by_name(self._session, self._cluster_names) if not self.dict_mors: raise exception.NotFound(_("All clusters specified %s were not" " found in the vCenter") % self._cluster_names) # Check if there are any clusters that were specified in the nova.conf # but are not in the vCenter, for missing clusters log a warning. clusters_found = [v.get('name') for k, v in six.iteritems(self.dict_mors)] missing_clusters = set(self._cluster_names) - set(clusters_found) if missing_clusters: LOG.warning(_LW("The following clusters could not be found in the " "vCenter %s"), list(missing_clusters)) self._vcenter_uuid = self._get_vcenter_uuid() # The _resources is used to maintain the vmops, volumeops and vcstate # objects per cluster self._resources = {} self._resource_keys = set() self._virtapi = virtapi self._update_resources() # The following initialization is necessary since the base class does # not use VC state. first_cluster = self._resources.keys()[0] self._vmops = self._resources.get(first_cluster).get('vmops') self._volumeops = self._resources.get(first_cluster).get('volumeops') self._vc_state = self._resources.get(first_cluster).get('vcstate') # Register the OpenStack extension self._register_openstack_extension()