Commit Graph

35 Commits

Author SHA1 Message Date
haixin 7f2b25332a remove usage of six library
remove usage of six library from the following directory:
1:share
2:volume
and some files.

Change-Id: If5bb2976bc54887c74649a00deaeaa71e296aaaa
2022-02-10 02:46:34 +00:00
Takashi Kajinami 1bbd229080 Cinder: Remove unused API
The get_volume_encryption_metadata method is implemented in the API
class but it is not used.

Change-Id: I24ebca15bc65b6894bca478c29023770e23b5dcc
2022-01-26 23:22:39 +09:00
Goutham Pacha Ravi 04e06968fd Handle service client authorization errors
Authorization errors when connecting
to nova/glance/neutron/cinder can be raised as
BadConfigurationExceptions in the logs. We shouldn't
be raising exceptions derived from the service client
libraries.

Change-Id: I2d47dbb1251dfa8d529f813724fb7fd97d7d3a0b
Closes-Bug: #1921927
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-06-24 15:45:04 +00: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
zhufl e8adec1b96 Fix parameters passed to exception
Do not pass reason parameter to ShareNotFound/ManilaException/
InvalidParameterValue/ShareGroupTypeNotFound/InvalidVolume, for
reason is not in the message format.

Change-Id: I4af25be0d5095c704b40fafbde3fafa298103596
2019-03-19 17:40:40 +08:00
Goutham Pacha Ravi 198bea78ac Deprecate old keystone session config opts
In the past, the options ca_certificates_file,
nova_ca_certificates_file, cinder_ca_certificates_file,
api_insecure, nova_api_insecure, cinder_api_insecure
were supplied to instantiate nova, neutron and cinder
clients. These options have now been subsumed in a more
generic way into the Keystone session logic as 'cafile'
and 'insecure'. Deprecate the older options in Stein so
that we can remove them in a future release.

This deprecation began many releases ago when we switched
to using keystone sessions [1]. However, we were still
overriding the values of "insecure" and "cafile" if provided,
forcing users to continue using deprecated parameters
"api_insecure" and "ca_certificates_file". So despite
this fix originating in the Stein release, it would be
prudent to backport it to all maintained releases and
remove support for these older options in/beyond Train
release (9.0.0).

[1] Ic211a11308a3295409467efd88bff413482ee58d
Change-Id: I148e9079c7c1ab119f519f727d4ad97758473325
Related-Bug: #1802393
Closes-Bug: #1809318
2018-12-20 17:29:40 -08:00
junboli 1ad8682614 Use v3 cinder client for share volume
Since cinder has been deprecated v2 api since Pike, So the
v3 cinder client should be used here to create share volume.
Also remove previously deprecated cinder client options.


Change-Id: I314f36637ab45faa638732238c438bf00cc641ea
Closes-Bug: #1733786
2017-11-30 16:20:31 +00:00
Valeriy Ponomaryov 11b38f3188 Add support of endpoint_type and region_name to clients manila uses
Since change [1] it is impossible to set endpoint_type and region_name
for nova, cinder and neutron clients that are used by manila in some
cases.
So, to fix it, add additional options called 'endpoint_type' and
'region_name' for each of config groups related to these clients.
These options can be defined in appropriate config group as following:

[nova]
endpoint_type = publicURL
region_name = SomeRegionName

[cinder]
endpoint_type = internalURL
region_name = SomeRegionName

[neutron]
endpoint_type = adminURL
region_name = SomeRegionName

[1] Ic211a11308a3295409467efd88bff413482ee58d

Change-Id: I6be0e77bbc0e4b1e9905eba7a7b48ff540e9e377
Closes-Bug: #1633454
2016-11-02 18:14:04 +02:00
Tom Barron 72ab1442ad Remove unused logging import and LOG global
This patch removes unused global LOG variable
and logging imports from various manila modules,
and adds a script to be run as part of pep8 that
will ensure that these do not creep back into
the codebase.

Change-Id: I162c4b2478df45aaf6ea8009b102d6de1a4e309e
2016-04-05 07:06:08 -04:00
Marc Koderer 8f7df3fc53 Capitalize global var for clients
TrivialFix

Change-Id: I84d67546e541b29f127057e6c7da990db71f6955
2016-03-23 10:00:55 +01:00
Marc Koderer 7fc492ea79 Fix keystone v3 issues for all clients
This fix basically ports nova fix https://review.openstack.org/#/c/136931/
plus additional bug fixing to Manila. It creates a common class to get
used for all clients (neutron, nova, cinder).

Idea is to create an auth session and pass this to the client object
instead of let the client do that. The auth session will be created by
a config group which means the configuration for the clients needed to be
heavily reworked. Patch is also backward compatible with old options but
flag them as deprecated.

DocImpact

Change-Id: Ic211a11308a3295409467efd88bff413482ee58d
Closes-bug: #1555093
2016-03-18 14:42:33 +01: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
Vincent Untz ef4393aefc Use existing "insecure" options when creating nova/cinder clients
Change-Id: I49e73e208516df19ba57ea9aa1f5f7b11b07bcb5
Closes-Bug: #1544929
2016-02-12 12:20:42 +01:00
Valeriy Ponomaryov 554b92e458 Fix exceptions handling for py34 compatibility
Fix following cases:

    "except SomeException, e:"
    "raise exc_value, msg, exc_trace"
    "e.message"

Partially-Implements: bp py3-compatibility

Change-Id: I8c20ae725000895b6b7b7c0da7d4bfba3e4849f0
2015-08-05 17:15:46 +03:00
Igor Malinovskiy 72728025a9 Implement extend_share() method in Generic driver
- Add implementation for extend_share() method
- Add appropriate unit tests

Partially implements bp share-extend-api

Change-Id: I81c4278a8caa75a2b475eaf5538a5ae6d3ed18d5
2015-06-04 09:40:33 +03:00
Igor Malinovskiy e1746d7137 Implement manage/unmanage support in generic driver
Add implementation of manage_existing() to Generic driver.
Generic driver accepts only one driver_option 'volume_id'.
If an administrator provides this option, then this Cinder
volume will be managed by Manila as well.

Partially implements bp manage-shares

Change-Id: I8767a7af75d575c57e8708563fa4a6bf2f4aa8ad
2015-03-18 20:43:51 +02:00
Valeriy Ponomaryov 63a0504c21 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.
So, start using oslo_log, but keep oslo-incubator code yet other common modules
within Manila codebase use it.

Implements bp use-oslo-log-lib

Change-Id: I88224f7c2bd99adb78140dfc3fa73cea437f29cd
2015-02-08 10:42:40 +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
Valeriy Ponomaryov bfed689614 Use Cinder v2 API within Generic driver
Manila uses v1 Cinder API for it's Generic driver.
Cinder v1 API is deprecated and is going to be removed,
see: https://blueprints.launchpad.net/cinder/+spec/deprecate-v1-api
So, update our Generic driver to use v2 Cinder API.

Implements blueprint v2-cinder-api-for-generic-driver

Change-Id: I3cbd713a9a4c6eccee50ba4af4bdf2794db021d7
2015-01-05 23:05:01 +02:00
Vladimir Vechkanov a7a517dec9 Add support for volume types with Generic driver
Add configuration option cinder_volume_type which can be used
to set volume type for cinder. If that option is not None then
cinder volumes will be created with type from that option.

Implements blueprint cinder-volume-types-with-generic-driver

Change-Id: Ica171410bfdfa001da5188450a0c3740b4b8eb65
2014-12-03 08:22:15 -05:00
Andreas Jaeger 630c08fbd4 Use oslo.utils - remove importutils usage
Use importutils from olso.utils instead of the deprecated version
from oslo-incubator.

These four files were missed in the previous change "Use oslo.utils"
with id I4f949de57e333832dcc7c1e256ce82e2db0144cb.

Change-Id: I198ea24a0512c60f11caad7cf8ae8c504442026d
2014-10-24 18:20:54 +00: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
Jenkins 8148c7a32e Merge "Fix some LOG.debug invocations" 2014-10-08 15:42:16 +00: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
Andreas Jaeger 24cb089fee Fix some LOG.debug invocations
LOG.debug("Hello %s" % xyz) should be LOG.debug("Hello %s", xyz).
This allows the logging package to skip creating the
formatted log message if the message is not going to be emitted because
of the current log level.

Change-Id: Ie0c91cd940017fd80d1d84b0e56780a1da980858
2014-09-16 08:04:09 +02:00
Jenkins 948aa13e7b Merge "Improve help strings" 2014-08-29 06:07:27 +00: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 2641eb9b57 Flake8: Fix and enable H405
Fix H405:
H405  multi line docstring summary not separated with an empty line

With this patch, flake8 passes all checks (incl. hacking checks)
except the on-purpose disabled check H904.
Closes-Bug: #1333290

Change-Id: If41259aefc4d6d588da5036f1f25df17b88db04f
2014-08-27 13:39:22 +02:00
Andreas Jaeger ab96ccb1ef Flake8: Fix H302
Fix H302 and enable the test:
H302  import only modules.'from X import Y' does not import a module

Fix also in the touched files the following:
E128 continuation line under-indented for visual indent

Change-Id: I3116c030a5dc0b5be2b4413beaa460e483215774
Partial-Bug: #1333290
2014-08-26 12:50:59 +02:00
Andreas Jaeger a7da88bb09 Fix pep8 failures in manila/{db,volume}
Fix pep8 failures, especially:
H402  one line docstring needs punctuation.
E127 continuation line over-indented for visual indent
E128 continuation line under-indented for visual indent
F401 'xxx' imported but unused

Partial-Bug: #1333290
Change-Id: Ia285d30574c3ad51b839823ea934e274f26ce6a3
2014-08-19 09:25:10 +02:00
Yulia Portnova 2c7595a386 Share servers implementation
Change-Id: I90664235237e25190191a4499e513a9fe589b855
2014-05-20 13:10:43 +03:00
Christian Berendt 79cd06323c debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: Idd917acd97481d6b644e307adb002354b37f34a1
2014-05-13 14:13:53 +02:00
Andrei V. Ostapenko fbde9ae88f Adds cinder api needed for generic driver implementation
Generic driver will use cinder volumes as back-end for shares,
so this patch adds a module for interacting with cinder.

Partially implements: bp generic-driver
Change-Id: Ide3d98efa8cf38994548934ad445f3561f5e3106
2014-02-10 10:10:29 +02:00
Yulia Portnova 9b20ae70ce Deleted manila.volume 2013-09-02 10:43:46 +03:00
Yulia Portnova dc4ce932ed Renamed cinder to manila.
Fixed setup.py, fixed bin scripts.
2013-09-02 09:59:07 +03:00