Commit Graph

52 Commits

Author SHA1 Message Date
silvacarloss 987352d6cb Change admin metadata config option name
This change is a follow-up to a change that merged recently [1].
We are changing the name of the config option to make it similar
to the policy we have defined for updating some metadata that
should only be manipulated by administrators.

[1] https://review.opendev.org/c/openstack/manila/+/909175

Related-Bug: #2050010
Change-Id: I9a8a27f1181b92291f2d4ad5fd9d4483e2dacc50
2024-03-08 20:36:35 +00:00
silvacarloss 3429717601 Add a new config option to specify admin metadata
- A new config option named ``admin_metadata_keys`` was introduced
and we expect it to be set in the DEFAULT section of the manila
configuration file. It is expected that administrators will provide
a list of metadata keys that can only be updated by administrators
through this configuration option.

- Drivers will be able to set metadata while creating shares
through the `get_optional_share_creation_data` driver interface.

Closes-Bug: #2050010
Change-Id: I6412710c7db89747d23033e1a5a6be9de5886b0b
2024-02-22 14:31:44 -03:00
haixin b4a0fd9af0 Update micversion to 2.77, support share transfer between project
user can create a transfer for a share. will return transfer id
and auth_key. another user can use transfer_id and auth_key to
accept this share. salt of transfer and auth_key compute crypt_hash
by sha1. then compare with crypt_hash in db.

APIImpact
DocImpact

Partially-Implements: blueprint transfer-share-between-project

Change-Id: I8facf9112a6b09e6b7aed9956c0a87fb5f1fc31f
2023-02-17 16:05:01 +08:00
haixin d51eb05c05 Update micversion to API2.69, Manila share support Recycle Bin
Add support share Recycle Bin, the end user can soft delete
share to Recycle Bin, and can restore the share within 7 days,
otherwise the share will be deleted automatically.

DocImpact
APIImpact
Partially-Implements: blueprint manila-share-support-recycle-bin

Change-Id: Ic838eec5fea890be6513514053329b1d2d86b3ba
2022-02-19 02:02:06 +08:00
Tom Barron 5af3b8e68b Remove deprecated config and auth
Remove manila configuration options
and auth classes that were deprecated
before the Ussuri release.

Change-Id: I148225926cd249a0dd8d1f8c02b22ed06487f405
2021-04-26 11:53:58 -04:00
Goutham Pacha Ravi 263d5438f0 Advertise v2 API routes without project_id
Manila APIs have had the requirement to include
project_id in the URLs since the very beginning.
This comes from an old assumption that our APIs
would be differentiated per-tenant on the cloud,
and we would allow different kinds of API endpoints
(public, admin, internal, etc). While it is possible
to set up different endpoints against the API
service, the same and complete API is exposed at
each of these endpoints.

We don't _need_ the project_id information that
we receive in the URL for any of our APIs to
function. We rather authorize tenants by gathering
information from the Identity service (Keystone)
and wrapping that into a RequestContext object
that we then rely on to ensure namespace isolation.

Removing the requirement for "project_id" simplifies
our API endpoint structure in the service catalog
as well as provides a way for system scoped users
to interact with manila without having to declare
their project.

In order to make project_id optional in urls, the
possible values of project_id have to be constrained.
This change introduces a new configuration option
so deployers may control that. This configuration
option defaults to accepting UUIDs with and without
dashes.

Since manila can be used in standalone deployments
without the need for Keystone, this change introduces
a noauth middleware that can work without project_id
in the URL paths.

The API version has been incremented to signal this
change to end users. When 2.60 is available, deployments
may drop "project_id" in the service catalog endpoint
for Manila and end users applications can stop needing
it as well (if they don't already rely on the service
catalog for this data).

APIImpact
Implements: bp remove-project-id-from-urls
Change-Id: I5127e150e8a71e621890f30dba6720b3932cf583
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-02-04 23:20:19 -08:00
haixin 6fb2e8510e remove usage of six library
remove usage of six library from the following directory:
1:common
2:data
3:db
4:message
5:network
6:scheduler

Change-Id: I9db0abf2b0847157074ca6ba84b5451bfe3f20d0
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-01-27 13:46:31 -08:00
Ghanshyam Mann 0cc7cbc36d [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also convert manila/tests/policy.json to manila/tests/policy.yaml
using oslopolicy-convert-json-to-yaml tool and replace
policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I3748313912b2527c43c9b16a6ba3e3ccd4cf5221
2020-12-13 00:05:00 +00:00
Zuul 9864761be0 Merge "Deprecated config option [DEFAUL]memcached_servers" 2019-01-25 14:10:58 +00:00
Thomas Bechtold 591fc8d9f6 Deprecated config option [DEFAUL]memcached_servers
The option is not used in the code so deprecate it and remove it in a
later release.

Change-Id: Ie607f263f5abc510134deda4b98cfd070b382687
2019-01-25 06:22:45 +01:00
Goutham Pacha Ravi 0f627aa6cf Deprecate [DEFAULT]/share_usage_size_audit_period
This option is unused and is likely going to confuse
deployers, especially when using the share usage size
tracking feature with a similarly named option
(share_usage_size_update_interval) [1].

We can remove this option in the Train release.

Closes-Bug: #1813054
[1] https://review.openstack.org/#/c/465055/

Change-Id: Id4585fa887e5bdfd5743dad2c490392ba0401061
2019-01-24 16:04:54 +00:00
Thomas Bechtold 5ce6f3843e Drop [DEFAULT]root_helper config option
The option is not used anywhere in the codebase. Manila uses "sudo"
together with "rootwrap".

Change-Id: If276a1bac32f5273c433805263d507e2fc3b2f26
2019-01-23 07:10:55 +01:00
Thomas Bechtold 941354d6cf Move/Drop useless SQL related config options
The following config option was moved to another place:

- [Default]sqlite_db : Only used for testing so move it to the test
  config options. That way, it is not visible in the
  manila.conf.sample file

The following config options were removed and are now handled via
oslo.db:

- [Default]sqlite_synchronous : already handled by oslo.db . The new
  place is "[database]sqlite_synchronous" but the deprecated
  section/names are handled
- [Default]sql_idle_timeout : already handled by oslo.db . The new
  place is "[database]connection_recycle_time" but the deprecated
  section/names are handled
- [Default]sql_max_retries : already handled by oslo.db . The new
  place is "[database]max_retries" but the deprecated
  section/names are handled
- [Default]sql_retry_interval : already handled by oslo.db . The new
  place is "[database]retry_interval" but the deprecated
  section/names are handled

Change-Id: I17e9b69d4ce4b8e624313d05f72d25b3fc2b458c
2019-01-03 15:55:29 +01:00
Thomas Bechtold ded9753e99 Remove "os_region_name" config option
It was not used anywhere.

Change-Id: Ia9257836ac1324808fc4687c3b5e5f654af0c419
2017-09-05 08:24:07 +02:00
Valeriy Ponomaryov 16bfc82962 Add possibility to run 'manila-api' with wsgi web servers
One of the goals for Pike [1] is to make each API service be able to
run under web servers that support WSGI applications,
such as Apache (+mod-wsgi) and Nginx (+uWSGI).

Do following to address governance requirements:
- Split existing manila/wsgi.py module into 3 modules:
  First (manila/wsgi/eventlet_server.py) is used by
  eventlet-based WSGI application approach.
  Second (manila/wsgi/wsgi.py) is used for WSGI web servers.
  And third (manila/wsgi/common.py) is common code for both.
  All three are made in cinder-like way to have alike-approach.
- Reuse common code from "oslo_service/wsgi.py" module that
  allows us to remove code duplication.
- Delete config opts that are defined by newly reused common code.
- Register new entry point that will be manila wsgi app: "manila-wsgi".
- Fix "manila/api/openstack/wsgi.py" module to be compatible
  with str/bytes handling approach used by Apache mod-wsgi plugin using
  different python versions (2/3).
- Add web server config template "devstack/apache-manila.template"
- Add devstack support where usage of this feature can be
  enabled or disabled using "MANILA_USE_MOD_WSGI" env var.
  It is set to "True" by default, because it is requirement for Pike
  release - to have it running in all CI jobs.
  Disable it only for one CI job that uses dummy driver and tests
  various manila core features that are not covered by other CI jobs.

[1] https://governance.openstack.org/tc/goals/pike/deploy-api-in-wsgi.html

Partially-Implements BluePrint wsgi-web-servers-support
DocImpact
Change-Id: Ibdef3c6810b65a5d6f3611e2d0079c635ee523ab
2017-04-10 12:49:20 +03:00
luqitao 86a1bc189c Use HostAddressOpt for opts that accept IP and hostnames
Some configuration options were accepting both IP addresses
and hostnames. Since there was no specific OSLO opt type to
support this, we were using ``StrOpt``. The change [1] that
added support for ``HostAddressOpt`` type was merged in Ocata
and became available for use with oslo version 3.22.

This patch changes the opt type of configuration options to use
this more relevant opt type - HostAddressOpt.

[1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb

TrivialFix

Change-Id: I44ba478ff14a6184434dd030efd9b7fa92458c7a
2017-03-21 08:14:01 -04:00
Alex Meade d25f101ab4 Manila Share Groups
Remove the experimental consistency group APIs and
replace them with the experimental Share Group APIs.

DocImpact
APIImpact
Partially-implements-blueprint: manila-share-groups

Change-Id: I79a80a62ae4e0015d6161edc2b93fd1f9ba69537
2017-01-23 21:29:12 +02:00
Li Wei ed59f6bd1a Use cors.set_defaults instead of cfg.set_defaults
Cors has been added setdefaults method, just use it.
Related link:
https://review.openstack.org/#/c/285368/

Change-Id: I26e1ecdf4a92ab55eeb794a0df7ba6a323f9141a
2016-11-04 14:48:51 +08:00
Thomas Bechtold 7578ad2df2 Remove enable_v1_api and enable_v2_api config opts
Both options are not used in the code and the help text already
mentioned that the variables will be removed.

Change-Id: I4b90080dde789b772323e1d93d5a08c4d9f342f5
2016-08-23 08:27:22 +02:00
Petr Kuběna 6e87a8419a Do not put real hostname and IP address to manila config sample
For the moment, building manila configuration sample, we get real
hostname and IP address of host that runs "genconfig" tox job. It
should not be exposed. So, hide it using "sample_default" arg for
appropriate options.

TrivialFix

Change-Id: Id8e5bdbc352229cf6a908a545e23ce62fd162ca4
2016-07-15 12:26:09 +00:00
daiki kato ad6cdb6e10 Fix typos
This patch fixes several typos.

TrivialFix

Change-Id: I169e15a0fdfbbcbeb1f87e3022b01fbb9353df01
2016-03-23 15:55:35 +09:00
Ben Swartzlander ce6924ae78 Collapse common os_region_name option
The os_region_name option appeared 2 places
in manila. This change moves them to the core
options list.

Change-Id: I5477c4e8b7c1523615fa50782d1c41e42e5f4fe6
Closes-bug: 1454590
2016-03-11 13:05:14 -05:00
Tin Lam 75d85aab3c Moved CORS middleware configuration into oslo-config-generator
The default values needed for manila's implementation of cors
middleware have been moved from paste.ini into the configuration
hooks provided by oslo.config. Furthermore, these values have been
added to the default initialization procedure. This ensures
that if a value remains unset in the configuration file, it will
fallback to using sane defaults. It also ensures that an operator
modifying the configuration will be presented with that same
set of defaults.

Change-Id: Ie4adc39866a4ee6132eab6a111660218b3e6e5bd
Closes-Bug: #1551836
2016-03-03 16:13:20 +00:00
Rodrigo Barbieri eaaa86f1f4 Introduced Data Service
Added a new service defined as data, whose purpose is to
receive requests, process data operations such as copying,
migration, backup, and send back the response after operation
has been completed.

In this patch the service has no methods, it is empty, the
operation it should perform will be added in subsequent patches.

Implements: blueprint data-copy-service
Change-Id: I31365c8ac4197541af175c82f8f18a3d11740a99
2016-03-01 17:13:51 -03:00
kutner bcb3ecfe51 Converted MultiStrOpt to ListOpt
Deprecating MultiStrOpt to standardize on ListOpt within Manila.

Change-Id: I0c664cd241bce8d55b5b7139e9c564bd6cb4cb4a
Closes-Bug:1534767
2016-02-12 15:04:00 +00:00
Shuquan Huang 8247f350af remove default=None for config options
In the cfg module default=None is set as the default value.

Change-Id: I9303e2ae4b8f301757744efc09136868db29472a
Closes-bug: #1323975
2015-11-08 20:12:25 +08:00
Clinton Knight 145165a22e Implement Manila REST API microversions
The OpenStack API working group recommends all projects adopt
Nova-style microversions for versioning their REST APIs.  This
commit ports the Nova microversion code and docs to Manila.

With this patch, the API version is bumped to 1.1, and the
versions API (which has always returned horribly outdated
values) is the first API that is versioned.  The 1.1 version
of the versions API includes the minimum and current API
version values.

Implements bp: manila-rest-api-microversions
Change-Id: Ifa8e394335a4eb3ad21f53a873530aee241c00e8
2015-08-13 19:51:19 +00:00
Valeriy Ponomaryov c017947f58 Make config opt 'enabled_share_protocols' verification case insensitive
Make opt 'enabled_share_protocols' expect share protocol names using any case.
Also, remove concatenation of translated messages and make explicit
unicode-transformation or these messages that is required when lazy translation
is enabled. That is case of Manila.

See http://docs.openstack.org/developer/oslo.i18n/usage.html#lazy-translation

Change-Id: Iadf41abd5ac62fcce0c0f63cd9a376a2c6eadd6e
Closes-Bug: #1475668
2015-07-22 15:06:16 +03:00
Victor Sergeyev 605ce734d6 Use oslo.utils to get host IP address
Change-Id: I11e2b90c23c9b820b85465452dce56dccefeea35
2015-06-09 14:13:35 +03:00
Valeriy Ponomaryov 94face22ea Sync oslo-incubator code
Sync common code from oslo-incubator. The main reason for it is removal
of usage 'log' module from incubator in manila codebase. Because we already
use another 'log' from library 'oslo_log'.

Head of oslo-incubator code that was used for 'sync' operation was at
following commit:

commit f5646edc61b9653d7ff71ed0177ed77811bbdcd0
Author: Elena Ezhova <eezhova@mirantis.com>
Date:   Tue Apr 7 17:46:16 2015 +0300

Additional changes:
- Added explicit registration of 'oslo_log.log' options to all manila scripts
- Module 'manila.openstack.common.log' removed as unused

Change-Id: I5b98d3863329227531fdb94ad7dbf5b3e5c51141
2015-04-22 11:20:25 +03:00
Jenkins b76becd303 Merge "Remove obsolete option: enabled_backends" 2015-03-01 21:32:45 +00:00
Ben Swartzlander 063bfde371 Remove obsolete option: enabled_backends
The correct option name is enabled_share_backends.
This change removes the obsolete option and corrects
the documentation to reference the correct name.

Change-Id: I616f6006966f33b261e8ead43bd7757c03797bef
Closes-Bug: #1425237
2015-02-28 19:08:35 +00:00
Valeriy Ponomaryov c0019bce6b Add snapshot gigabytes quota
Manila has used single gigabytes quota for shares and snapshots.
Config opt 'no_snapshot_gb_quota' is set to False by default, that has been
used for enabling/disabling of snapshot gigabytes quota considerations.

Add separate snapshot gigabyte quota and remove opt 'no_snapshot_gb_quota' that
is not needed anymore. To be able to set infinite quota for snapshot gigabytes,
just set value for new config option 'quota_snapshot_gigabytes' to '-1'.

Change-Id: I43cb95ff3d0d3e6191f520b52edb67a0a44e9c2c
Implements BP add-snapshot-gb-quota
2015-02-26 07:42:28 +00:00
Jenkins d9a227d12c Merge "Add support of default share type" 2015-02-18 14:58:07 +00:00
Igor Malinovskiy b369f2ba8a Add support of default share type
Implement possibility to set up default share type for share creation.
If default share type is set up and in case no share type is specified,
a default share type will be provided with the share creation request.
It is useful when we want some specific back end to be used in common
cases instead of weighed back ends.

How to use it:

1) add to manila.conf file following option
default_share_type = some_st_name
to [DEFAULT] group of config.
2) restart manila API service if was started
3) create share type with name "some_st_name"
4) add some extra specs to share type, for example:
share_backend_name = cheap_backend

Implements blueprint default-volume-type

Change-Id: Ief32825360cbb3e7df9149e8980c11c5018f52f7
2015-02-17 10:34:13 +02:00
vponomaryov d3cfecca83 Move definition of couple of config opts to proper module
Define config options 'osapi_max_limit' and 'osapi_share_base_URL' in proper
module to be able to run module "manila.api.common" without import of
module "manila.common.config". Without it all unit test modules that import
"manila.api.common" fail due to not defined mentioned config opts.

Change-Id: I725ab6cc7d777b3384bdd9095c72ecd65079e6cf
Closes-Bug: #1194315
2015-02-16 17:10:55 +02:00
Valeriy Ponomaryov 4d19edb989 Add possibility to enable/disable some share protocols
It is useful in case we use share backends that do not implement some share
protocol or want to disable something for some other reason. For the moment,
there is no share driver that supports all share protocols in Manila.

Change-Id: I80a6a7927aa897931a84d310b657d0af06f02823
Closes-Bug: #1403161
2015-02-13 08:12:59 +02:00
Jenkins 797e7a9164 Merge "fix typo in config.py" 2015-02-03 09:51:05 +00:00
Thomas Bechtold 071d0b59c1 Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
oslo.messaging is the only exception because this package doesn't
currently support non-namespaced imports.

Change-Id: I3987e651bc880c8ffa7c0105df0298679dcd3a43
2015-01-27 09:19:50 +01:00
Danny Al-Gaaf 4377465dc3 fix typo in config.py
Change help text from GigaByte to Gigabyte.

Change-Id: Ic8e1f4472812aa501ffa0588b782f9fce5832af4
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-01-21 23:00:29 +01:00
Thomas Bechtold 1e069c6be4 Remove configs sql_connection and sql_connection_debug
Both configuration options are available and used from the [database]
section under the names 'connection' and 'connection_debug'.

Change-Id: I7178ee9fce3b95c887d9b7e5d5564873aae69c88
2014-12-22 10:53:47 +01:00
Thomas Bechtold cc2825fb77 Remove unused configs pybasedir and bindir
Both options are leftovers from the initial Cinder fork and are not used
for anything useful.

Also use a sane default for 'state_path' which pointed to $pybasedir and
now points to '/var/lib/manila'.

Change-Id: I95d824cd81c98815fde6c312b0e4fd38fb4c88e9
2014-12-22 10:03:46 +01:00
Thomas Bechtold b4e2dd81f6 Remove unused connection_type config
This parameter was a leftover from the original Cinder fork. But even in
Cinder the parameter has been already removed (see
https://github.com/openstack/cinder/commit/fce28fe9).

Change-Id: I0a030217cde194cbd129c9100f276f4267b001d9
2014-12-22 09:33:58 +01:00
Andreas Jaeger 7b659fc4e0 Use oslo.i18n
oslo.i18n provides the i18n function that were provided by
oslo-incubator's gettextutils module

Import _ where needed, oslo.i18n deprecated the builtin method.

Closes-Bug: #1382187
Change-Id: I12aa1c725aa4bb52a9aa46e9c3d2b303839de48b
2014-10-19 19:21:03 +02:00
Marc Koderer ecf603bc05 Remove vim headers
As discussed in [1] remove all vim headers from manila files.

[1]: http://lists.openstack.org/pipermail/openstack-dev/2013-October/017353.html

Change-Id: I341486c66ffe4dad7db8608fdc66868ceb7ad95a
Closes-Bug: #1229324
2014-10-06 15:00:27 +02:00
Jenkins 06672b2cbf Merge "Remove redundant glance config options" 2014-08-29 06:07:34 +00:00
Jenkins 948aa13e7b Merge "Improve help strings" 2014-08-29 06:07:27 +00:00
Andreas Jaeger ba9d01ef88 Remove redundant glance config options
These config options are not used anymore, remove them.

Change-Id: I2d5e08c6977420d7b0430820c7e2f506f8d70675
2014-08-28 08:55:03 +02:00
Andreas Jaeger ab61d9bad4 Improve help strings
Make help strings consistent:
* Add missing spaces between words
* Capitalize first word of help
* Add "." at end of string
* Improve wording and capitalization

This follows the oslo.config style guide:
http://docs.openstack.org/developer/oslo.config/styleguide.html

Change-Id: I8243909249423b6b58ccda0d800856f46b0953c5
2014-08-28 06:56:59 +02:00
Andreas Jaeger 8203c51081 Flake8: Fix and enable H404
Fix and enable flake8 test H404:
H404  multi line docstring should start without a leading new line

Change-Id: I13dc13bb5e81d65300680df094cde538c7a6f6df
Partial-Bug: #1333290
2014-08-27 10:47:45 +00:00