Commit Graph

9 Commits

Author SHA1 Message Date
haixin a73b299374 Remove usage of six lib for third party/vendors drivers.
Python2 is no longer supported, so in this patch
set we remove the usage of the six (py2 and py3
compatibility library) in favor of py3 syntax.

Change-Id: I3ddfad568a1b578bee23a6d1a96de9551e336bb4
2022-01-29 03:01:17 +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
Chris Yang ad62e9dde3 QNAP: Fix inconsistent cases while create/manage from snapshot
There are two situation may cause the size of share/snapshot
managed by manila is inconsistent with the NAS backend.
One is to create a share from snapshot. While the other one
is to manage an existing snapshot.

Change-Id: Iaef8d8cb4be0d8872a2796c0fc69279c14f15a80
Closes-Bug: #1810476
2019-01-04 18:38:32 +08:00
Chris Yang a3314dbef9 QNAP: driver changes share size when manage share
After manage share, driver updates the share size.
The share size should not be updated.

Change-Id: I5f670495cd61b63d1c0669c274b502a6a691e4e2
Closes-Bug: #1773761
2018-06-09 14:03:54 +08:00
Chris Yang 487aa691fd Add support for enhanced features to the QNAP Manila driver
This adds enhanced supports to the QNAP Manila driver:
 - Thin Provisioning
 - SSD Cache
 - Deduplication
 - Compression

Change-Id: I0c92ecf6ac55e2f6fbf1d41132e97fa2d40c3ebd
Implements: blueprint qnap-enhance-support
2018-01-05 15:01:10 +08:00
Chris Yang 205ef44283 QNAP Manila driver: Access rule setting is override by the later rule setting.
When user try to add access rule1 and access rule2, share will first set to
the rule1 and then override by the rule2.

We expect that share should apply both access rule1 and access rule2.

Change-Id: Id77cffb5efe4388e3b66aa85fc89cf6f51d5bd98
Closes-Bug: #1736370
2017-12-25 09:32:02 +08:00
Chris Yang 4c2b5e9335 QNAP: Add support for QES 1.1.4
This patch do the following changes to the QNAP Manila driver:
1. Add support for QNAP QES firmware 1.1.4.
2. Correct the default parameters in edit share function.
2. Remove unused code flow.
4. Add more debug log and write more test cases.

    Implements: blueprint support-qes-114

Change-Id: I977ef3e66a21a52116b44059ad5aeaf1560b47b7
2017-12-06 14:47:52 +08:00
yfzhao 89b453be50 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using
iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable. 2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I52b4ea9445143afc5e2f5f050373951a61a39327
2017-04-07 14:00:17 +08:00
Pony Chou cf182947b7 Add QNAP Manila Driver
This driver supports below features:
 - Create NFS Share
 - Delete NFS Share
 - Allow NFS Share access (IP access type)
 - Deny NFS Share access
 - Create snapshot
 - Delete snapshot
 - Create share from snapshot
 - Extend share
 - Manage share
 - Unmanage share
 - Manage snapshot
 - Unmanage snapshot

DocImpact
Implements: blueprint qnap-manila-driver

Change-Id: I4e4278a870af7be1c026385b85ea309b2d1773a9
2017-01-21 21:46:15 +08:00