Commit Graph

225 Commits

Author SHA1 Message Date
Maurice Escher e34e8f7fc3
sqlalchemy: add generic repr to base model
Instead of
`<manila.db.sqlalchemy.models.ShareServer object at 0x7f603645bf40>`
we now get
```
ShareServer(created_at=datetime.datetime(2023, 4, 18, 15, 44, 43, 741302),
updated_at=datetime.datetime(2023, 4, 19, 10, 18, 59, 614018),
deleted_at=datetime.datetime(2023, 4, 19, 10, 18, 59, 613577),
id='3363dcd4-fcdd-4cfa-b02d-5899fba3d413',
deleted='3363dcd4-fcdd-4cfa-b02d-5899fba3d413',
share_network_subnet_id='8d4365dc-0869-4896-8049-6455f84ad08f', ...)
```
e.g. in error messages of failed purges or in interactive shell sessions.

Change-Id: I5e6513e7ca7b4a9d4d7261f873cbf3f5bf3c83ab
2023-04-19 10:20:37 +02:00
Tobias Urdin 91b9985a32 Use new get_rpc_client API from oslo.messaging
Use the new API that is consistent with
the existing API instead of instantiating the client
class directly.

This was introduced in release 14.1.0 here [1] and
added into oslo.messaging here [2]

[1] https://review.opendev.org/c/openstack/requirements/+/869340
[2] https://review.opendev.org/c/openstack/oslo.messaging/+/862419

Change-Id: I49ca4bfe14824c53faf71d90474050f8420ea0ea
2023-01-19 20:33:42 +00:00
Ghanshyam Mann 392894afee Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: I8457c0793d303aa7e95e0402260a788513feba77
2022-04-30 20:23:50 -05:00
silvacarloss 777954b924 Implement privsep boilerplate in Manila
Add the privsep module to Manila, as well as its initialization.
All changes to other Manila calls will be reusing this new module
and the new root context brought by it.

Partially-Implements: bp privsep-migration
Change-Id: I35bd548894d96ed66faab4ede7c16f28e9755663
2022-02-15 18:46:41 -03:00
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
ashrod98 903aab1920 Replace retrying with tenacity
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see [1] for more details). Our end
goal here is removing the retrying package from our requirements.

Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- Tenacity uses seconds rather than ms as retrying did
  (the retry interface in manila exposed time in seconds as well)
- Tenacity has different kwargs for the decorator and
Retrying class itself.
- Tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg - we are going to set this in the retry interface
by default.
- For retries that check a result, tenacity will raise if the
retried function raises, whereas retrying retried on all
exceptions - we haven't exposed this in the retry interface.

This patch updates all usages of retrying with tenacity.
Unit tests are added where applicable.

[1] https://github.com/jd/tenacity

Co-Authored-By: boden <bodenvmw@gmail.com>
Co-Authored-By: Goutham Pacha Ravi <gouthampravi@gmail.com>
Closes-Bug: #1635393
Change-Id: Ia0c3fa5cd82356a33becbf57444f3db5ffbb0dd0
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-09-01 18:31:38 -07:00
Chuan Miao e5d0c0e77a Pass sync_backref=False to relationship call
Need to bump the lower-constraint of sqlalchemy
to a version where 'sync_backref' was introduced [1]

[1] https://docs.sqlalchemy.org/en/13/orm/relationship_api.html#sqlalchemy.orm.relationship.params.sync_backref
Change-Id: I589281d8e77a160adcd48b8d3e4951441f843463
Closes-Bug: #1924806
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-07-13 17:26:39 -07:00
Goutham Pacha Ravi 6f68d7e60f Move params from DocumentedRule to DeprecatedRule
Oslo policy moved "deprecated_*" parameters to the
DeprecatedRule object in [1] and deprecated it in
DocumentedRuleDefault object. Also bump oslo_policy
to the 3.7.0.

Similar change in neutron: https://review.opendev.org/781561
[1] https://review.opendev.org/766628

Change-Id: I14b215cdcd6458d67622360e4c910b3da1ae9848
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-03-23 16:56:48 -07:00
Goutham Pacha Ravi 8553962997 Clean up some policy code
oslo policy handles the mapping of
credentials from a context object to values
that oslo policy cares about. This mapping
includes some deprecations and compatibility
handling code that we must take advantage of [1].
So, stop mapping context to policy values
on our end, and rely on oslo.policy handling
this for us.

enforce and authorize methods in policy.py
do the same thing, but with a subtle
difference. The "enforce" method doesn't
raise errors when unregistered policies are
invoked - this shouldn't ever be the case
for any policies written/maintained within
manila - however, we support API extensions
and don't dictate what must be done there. So
add docstrings to clarify that we shouldn't
invoke enforce, ever.

Also handle InvalidPolicyScope exceptions
and raise the oslo.policy library version
since some test enhancements have been
committed in the latest version.

[1] d3185debdb/oslo_policy/policy.py (L1077-L1096)

Change-Id: I069bf7143d6ff66b3dcdc34c9b52d48f5808481b
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-02-25 23:41:57 -08:00
kpdev fbc2b4d289 Integrate OSprofiler and Manila
*) Add osprofiler wsgi middleware

This middleware is used for 2 things:
1) It checks that person who want to trace is trusted and knows
secret HMAC key.
2) It start tracing in case of proper trace headers and add
first wsgi trace point, with info about HTTP request
*) Add initialization of osprofiler at start of serivce.

You should use python-manilaclient with this patch:

https://review.opendev.org/#/c/769731

Run any command with --profile SECRET_KEY

  $ manila --profile SECRET_KEY create NFS 1 --name <share> \
    --description <share_description> --share-network <network> \
    --share-type default
  # it will print <Trace ID>

Get pretty HTML with traces:

  $ osprofiler trace show --html <Trace ID> --connection-string \
   <connection_string> --out <output.html>
  e.g. --connection-string can be redis://localhost:6379

Note that osprofiler should be run from admin user name & tenant.

Implements: blueprint manila-os-profiler
Change-Id: I3bce1f04d1cfebfacd78ed135a949a068c78987d
2021-02-25 04:59:19 +01: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
Goutham Pacha Ravi c0ee884861 Update requirements
pip 20.3 brings in a strict dependency resolver which
is enabled by default. This causes our lower-constraints
tests to fail, because the requirement files were out
of date from reality - they had conflicting requirements
which previous versions of pip were ignoring. Let's catch
up package versions to newer ones that are supported in
the python runtimes that the Wallaby release will be
deployed to.

[1] http://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html
[2] https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020

Change-Id: I5a31b561654aa368bb85a56f4dd38276cfdbb91a
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-12-10 19:48:15 -08:00
Lance Bragstad a10927c6be Bump oslo.log version to 4.3.0
This allows us to use the WALLABY marker in oslo.log's versionutils for
deprecated notices.

Change-Id: I2e6c482989095ea8e102e5afe2e2f57214fe6f06
2020-11-18 22:17:11 +00:00
Ghanshyam Mann ffd3f1e760 [goal] Migrate tox based testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8 support
in their later version.

Story: #2007865
Task: #40194
Depends-On: https://review.opendev.org/#/c/738328/

Closes-Bug: #1886298

Change-Id: Ib0f84e8c3815be48bca0ae8d4fe15a56b5256c20
2020-09-09 13:19:39 -05:00
junboli 1982b90c07 Fix NFS/CIFS share creation failure issue
When the image count is over 25, there might not get
manila-service-image, because current manila shares
creation is using novaclient to get image info, but
novaclient can only get 25 images due to pagination
of glance server, So this change is to switch to use
glanceclient instead of novaclient to get image info,
because glanceclient can iter all image info, while
novaclient is rarely maintained with stuff of image
API.

Change-Id: Id1715d0b9cb3a4aeedeb23d9b1d9924a78d18dc6
Closes-Bug: #1741425
2020-06-30 12:46:28 -04:00
zhangbailin 458f307df6 Remove Babel requirement
Babel is not needed as requirement, remove it.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014227.html

Change-Id: Ie53e0e56405c3c250b1c33f9ce0dc6c65d13cdc9
2020-04-27 10:39:23 +08:00
Goutham Pacha Ravi 0a499674d5 Drop install_command usage in tox
Use the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

See discussion on the openstack-discuss ML [1]
for the complete context.

To get this fix in, we'll need to raise
a few requirements:

- eventlet because of the ssl issues with python3.6 in
  older packages
  (https://github.com/eventlet/eventlet/issues/371)
- oslo.messaging to fix the error "ACCESS_REFUSED - Login
  was refused using authentication mechanism AMQPLAIN.".
- psycopg2-binary since 2.6.2 is blacklisted
- oslo.service was bumped to 2.1.0, to pick up its support
  for eventlet>=0.22
- oslo.utils was bumped to match the lower constraint from
  oslo.service at 2.1.0

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014237.html

Change-Id: I6344f44fb955d631a4f0a13fa53ecc19826c7ea6
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-04-23 08:28:50 +00:00
Andreas Jaeger a4d4159820 Cleanup Python 2.7 support
OpenStack is dropping the py2.7 support in ussuri cycle.

Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove section from setup.cfg: Wheel is not needed for python
  3 only repo
- Update requirements

Change-Id: Ibca03f9ebaeaca595e027be9cb5900c368c8de6d
2020-03-27 16:55:52 +01:00
pengyuesheng c295397260 Blacklist python-cinderclient 4.0.0
This release of the Cinder client broke support for the v3
volume-transfer APIs unless microversion 3.55 or higher was requested.
depend on https://review.opendev.org/#/c/587877/

Depends-On: Ibbc3a3f04ea6253139112944cf7e0f6c265d0f26

Change-Id: Icb4c948e9f8ea879f5c2bc5d854df6696ee8e6a7
2019-06-10 09:11:59 +08:00
whoami-rajat 1f005beb58 Add manila-status upgrade check command framework
This adds basic framework for manila-status upgrade
check commands. For now it has only "check_placeholder"
check implemented.
Real checks can be added to this tool in the future.

Change-Id: Id809535d0a01617916a8e29f151ca4e61f738fad
Story: 2003657
Task: 26139
2018-10-19 12:53:03 +05:30
Doug Hellmann dd78fc3e10 uncap eventlet
We will manage the eventlet version using constraints now. See the
thread starting at
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129096.html
for more details.

Also adjust lower_contstraints.txt to match requirements.txt and
test_requirements.txt so that the requirements job will pass.

Change-Id: Ib1d74405c239f0a7d62f327a3aad6a9c8fd549e7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-22 13:13:04 -04:00
OpenStack Proposal Bot 09a38629eb Updated from global requirements
Change-Id: I3e146eaf31829bb870fc730f4d56b618a60e4c8c
2018-03-26 08:07:37 +00:00
OpenStack Proposal Bot 627efa714e Updated from global requirements
Change-Id: I64f3bc5686b5ab4f81b6462da60febd66fbf3499
2018-03-23 01:06:24 +00:00
OpenStack Proposal Bot e568ca9ea9 Updated from global requirements
Change-Id: Ied2c959a45a28c2582001dd10a613509538c6aa2
2018-03-04 10:08:25 +00:00
OpenStack Proposal Bot 6b59bf704e Updated from global requirements
Change-Id: I8c1b97ab83cb238ac6289fd94de9db2ca496c005
2018-02-17 09:38:18 +00:00
Tom Barron b70b85386a Revert Id905d47600bda9923cebae617749c8286552ec94
Change-Id: I185145e5738bb5251d7c50bd04255f0045fd82f8
2018-02-07 17:13:52 -05:00
Zuul 7bf8148fdf Merge "Fix NFS/CIFS share creation failure issue" 2018-02-07 03:23:58 +00:00
OpenStack Proposal Bot f72d8f8351 Updated from global requirements
Change-Id: Ic9a52f8a984482dd189e08b902b6d6cbf344a1bf
2018-01-16 12:32:41 +00:00
junboli 51dd510636 Fix NFS/CIFS share creation failure issue
When the image count is over 25, there might not get
manila-service-image, because current manila shares
creation is using novaclient to get image info, but
novaclient can only get 25 images due to pagination
of glance server, So this change is to switch to use
glanceclient instead of novaclient to get image info,
because glanceclient can iter all image info, while
novaclient is rarely maintained with stuff of image
API.

Change-Id: Id905d47600bda9923cebae617749c8286552ec94
Closes-Bug: #1741425
2018-01-12 09:25:04 +08:00
OpenStack Proposal Bot cc1e941f3b Updated from global requirements
Change-Id: Id4fa24194bacb1d0838393a38f8134eed4c04476
2017-12-22 02:57:02 +00:00
OpenStack Proposal Bot daf509b66f Updated from global requirements
Change-Id: Iacf62484110250ff1f7763b037bab73603d002af
2017-12-19 01:22:37 +00:00
OpenStack Proposal Bot ba25aaf543 Updated from global requirements
Change-Id: I6c87e77b5a55e1a22112c7fa5d2fdd9f0335b27c
2017-12-15 21:36:48 +00:00
OpenStack Proposal Bot d365f3aeab Updated from global requirements
Change-Id: I818df5f144b84d6fefa672ee6d850ffeea9736dd
2017-12-10 07:12:01 +00:00
OpenStack Proposal Bot 128460ff83 Updated from global requirements
Change-Id: Idb5db856293d41cf2ca2b133b9f20944489c2aa8
2017-12-07 13:29:21 +00:00
OpenStack Proposal Bot e741319d57 Updated from global requirements
Change-Id: I8988e88e1a26e417bf0639383420587abbe21227
2017-11-29 09:00:18 +00:00
OpenStack Proposal Bot ca1b09967d Updated from global requirements
Change-Id: Id7bc6041e874a6c7c065053f4b8db9fc4ee0f3bc
2017-11-16 11:09:16 +00:00
OpenStack Proposal Bot a1aeddd5fd Updated from global requirements
Change-Id: Ia6b3c4a6eee49b7e1ff4417ace1629a43f5e59ea
2017-11-12 20:59:27 +00:00
OpenStack Proposal Bot 08aa0d486c Updated from global requirements
Change-Id: Ia7da23ae424b74248dc3ecca70c5890a0135cf46
2017-11-03 00:57:06 +00:00
OpenStack Proposal Bot ef8bbdf7cc Updated from global requirements
Change-Id: I20ce38e3f14e432c052031ba5d862a730ae7865a
2017-10-14 00:37:06 +00:00
OpenStack Proposal Bot cae8f9110b Updated from global requirements
Change-Id: I892488f8d9dfa538aa0271f59f384cf63c1a03af
2017-09-27 17:12:17 +00:00
OpenStack Proposal Bot 8ba06fcf98 Updated from global requirements
Change-Id: I86e4357b31980ae3f0f318bdd8ba1b1cdf661298
2017-09-20 16:16:11 +00:00
OpenStack Proposal Bot 3e49465e80 Updated from global requirements
Change-Id: I485e2c4a17e0c9aac72b2f0638da1a8380ca390d
2017-09-13 12:52:45 +00:00
OpenStack Proposal Bot c9ab5b835a Updated from global requirements
Change-Id: I0727ff47e1132210d1a81734fb4c76eeef0828db
2017-09-02 22:20:31 +00:00
OpenStack Proposal Bot 1bd85a4683 Updated from global requirements
Change-Id: I07598d03a378324731c46de9b26156450e2e55ca
2017-08-26 11:34:30 +00:00
OpenStack Proposal Bot f68cd21d55 Updated from global requirements
Change-Id: I8cdf0bf9ced02626eb576a51369d490a9b55f0c8
2017-08-18 11:32:18 +00:00
zhongjun e202f758d2 Add ipaddress in manila requirements
The ipaddress module required by recent ipv6 work:
https://review.openstack.org/#/c/312321/80/manila/api/common.py

Change-Id: Idd0014d898d5468922625e62f9e649936dc05e35
2017-07-29 15:36:11 +08:00
OpenStack Proposal Bot 8f365c652f Updated from global requirements
Change-Id: Iebc41c515c0a6a71de2b1ab4ceb7575e6498d8bb
2017-07-28 14:45:51 +00:00
OpenStack Proposal Bot 7555048bbf Updated from global requirements
Change-Id: I6347c5b0df41d9d69854d67cd5cbf90c39ae4f8e
2017-07-27 20:23:36 +00:00
OpenStack Proposal Bot 1b6ba7dc62 Updated from global requirements
Change-Id: I5e01dccd5eda3124cd42bb809fc03fd37c6016c7
2017-07-23 19:00:09 +00:00
OpenStack Proposal Bot 48b88b0389 Updated from global requirements
Change-Id: Id2c097904c96cade2e8ad8afe5dc748c985165ad
2017-07-20 13:16:22 +00:00