Commit Graph

23 Commits

Author SHA1 Message Date
jayaanand.borra@netapp.com ea1ac5f448 Human readable export location core implementation
Export locations are usually too difficult to memo
rize.Currently, there is no way to determine the
export location before the share is created, so
users wait until the share creation request gets
completed, and then they check the export
locations to mount the share. The generated
export locations are often not human readable
 and it is hard to memorize and control them.

Implements: bp/human-readable-export-locations
Change-Id: I72ac7e24ddd4330d76cafd5e7f78bac2b0174883
2024-03-07 17:20:30 -05:00
haixin 03fea855d9 remove usage of six library in api layer
Replace six with Python 3 style code.

Change-Id: I091a45c04686ac8d036107618945fea65fb4a2cf
2021-12-22 10:08:11 +08:00
Victoria Martinez de la Cruz 3a1e23801f Support group specs search for share group type API
Add support for group_specs filter search in share group type list API.

Implements: blueprint support-group-spec-search-share-group-type-api
Change-Id: I10caed1d524614a74a75e8f856b0579ab11dc4b5
2021-12-09 17:26:11 +00:00
songwenping 8ee8ee15b1 Replace assertDictMatch with assertDictEqual method in tests
assertDictMatch was introduced for Python 2.6 only.
Python 2.7+ contains assertDictEqual.

Closes-Bug: #1646433
Change-Id: I41738cc0bd90656508fc6ff390072b55130cc6fc
2021-07-14 01:32:08 +00:00
Goutham Pacha Ravi 598223985a Use unittest.mock instead of third party lib
mock was adopted into standard python
in version 3.3 [1]. Since manila no longer
supports python2.7, we can use the inbuilt
mock package rather than the third party
lib.

Fix some issues with imports that weren't
following our import conventions of grouping
imports [3]

Add a hacking test to ensure we don't regress
on this.

[1] https://docs.python.org/3/library/unittest.mock.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013281.html
[3] https://docs.openstack.org/hacking/latest/user/hacking.html#imports

Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Change-Id: If857a49fbf526983e712282a25d7e8bef5093533
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-04-17 16:24:27 -07:00
haixin 01e89ae26b Add update share-type API to Share Types
Currently, only the name and description and public access of share-type
is set when the share-type is created, and not allowed to be edited
after the share-type is created. We can only set extra spec for share-type.
But not name or description or public access for share-type.

Co-Authored-By: Brin Zhang <zhangbailin@inspur.com>
APIImpact

Implements: blueprint update-share-type-name-or-description
Change-Id: I4c7bdd601d48b40c01639b5089d4bff259a7b3af
2019-09-10 14:43:07 -07:00
lijunbo cf677f2603 Retrieve is_default value to fix empty display in CLI
This bug is from path[1], when we use manila client to create
a share type or share group type, the is_default value is always
empty, so add the is_default value when we create each share type
or share group type.

Closes-bug: #1743941
[1] Ib264d8422fe57701f990cbbf7ea5d1e90b8b0008

Change-Id: Ia8bcb632591fc0b5438847b22ec59c2039ecf5f1
2018-07-24 12:00:58 +08:00
Goutham Pacha Ravi fd23a6387c Use class name in invocation of super
Fix pylint E103 warning raised by usage of
self.__class__ to refer to the derived class
in super() methods.

self.__class__ is a reasonable first argument
to super() in any method of a class, as long
as the method is not going to be invoked in
derived classes.

Python3 removes this ambiguity by not requiring
arguments for the super() method.

[1] https://docs.pylint.org/en/1.6.0/features.html#id33

Change-Id: I6071b6cfd8cff2be3853d739f71b94da990cda97
2018-06-06 17:47:18 -07:00
junboli 6af780c1e4 Fix default and detailed share type result not correct
When request default share type and show share type detailed,
the share type results is not correct, because the values of
attribute required_extra_specs is always empty.

Change-Id: I68fc4e2ba30bbd87b5417fe48688edd96cbcee5d
Closes-Bug: #1733742
2017-12-22 14:49:07 +00:00
zhongjun 125651d566 Add 'description' in share type APIs
This fix add attr 'description' in list/create share
type APIs.

Change-Id: I39705acbfca812b66d74fbd2fee228a7a85bc2d8
Closes-Bug: #1724183
2017-11-22 13:28:41 -05:00
zhongjun 341161eead Use parenthesis instead of backslashes in tests folder
Use parenthesis instead of backslashes in tests folder

TrivialFix
Change-Id: I6c2ea07b0bfc5852b28e44989406cc10eb972e53
2017-06-19 17:56:01 +08:00
zhongjun 052b100be5 Remove unused self.context
Remove unused self.context

TrivialFix
Change-Id: I03ae35b67e76b382b04747541afab0e4f574942b
2017-05-10 09:25:38 +08:00
tpsilva 8d71932c69 Add mountable snapshots support
This new feature gives the user the ability to allow and
deny access to the snapshots, so that they could be mounted in
read-only mode to retrieve files.

APIImpact
DocImpact

Co-Authored-By: Rodrigo Barbieri <rodrigo.barbieri@fit-tecnologia.org.br>
Co-Authored-By: Alyson Rosa <alyson.rosa@fit-tecnologia.org.br>
Co-Authored-By: Miriam Yumi <miriam.peixoto@fit-tecnologia.org.br>

Partially-implements: blueprint manila-mountable-snapshots
Change-Id: I65f398a05f82eef31ec317d70dfa101483b44b30
2017-01-24 17:26:45 -02:00
Clinton Knight d4a379d083 Implement share revert to snapshot
This commit adds the ability for Manila to revert a
share to the latest available snapshot.

The feature is implemented in the LVM driver, for
testing purposes.

APIImpact
DocImpact
Co-Authored-By: Ben Swartzlander <ben@swartzlander.org>
Co-Authored-By: Andrew Kerr <andrew.kerr@netapp.com>
Implements: blueprint manila-share-revert-to-snapshot
Change-Id: Id497e13070e0003db2db951526a52de6c2182cca
2017-01-17 15:06:01 -05:00
Clinton Knight 0d6db3588c Add create_share_from_snapshot_support extra spec
The snapshot_support extra spec has always meant two
things: a driver can take snapshots and create shares
from snapshots. As we add alternate snapshot semantics,
it is likely that some drivers will want to support
snapshots and some of the new semantics while being
unable to create new shares from snapshots.

This work adds a new extra spec,
create_share_from_snapshot_support, that removes the
overloading on snapshot_support. It also makes the
existing snapshot_support extra spec optional,
allowing admins to create types without setting
snapshot_support; shares created with such types
will not support snapshots.

APIImpact
DocImpact

Co-Authored-By: Goutham Pacha Ravi <gouthamr@netapp.com>
Implements: blueprint add-create-share-from-snapshot-extra-spec
Change-Id: Ib0ad5fbfdf6297665c208149b08c8d21b3c232be
2016-12-21 09:57:08 -05:00
Bin Zhou b6fa89bae3 Modify use of assertTrue(A in B)
Developers should use assertIn(A, B) instead of assertTrue(A in B ).

TrivialFix

Change-Id: Icb1f58f462f982d9c4b0795d1a7f010b08c9b387
2016-09-20 09:11:20 +08:00
daiki kato 8b6cedf077 Fix typos
This patch fixes several typos.

TrivialFix

Change-Id: I77e680a39eab00d61651e267bafebf0c116c2ee6
2016-03-14 16:51:55 +09:00
Jenkins 858afaf1e0 Merge "isoformat instead of deprecated timeutils.isotime" 2016-02-05 06:46:33 +00:00
binean 084cb0ea0a isoformat instead of deprecated timeutils.isotime
oslo_utils/timeutils have deprecated isotime(), so we use
utcnow().isoformat() instead.

ref:
https://github.com/openstack/oslo.utils/blob/master/oslo_utils/timeutils.py#L50

Change-Id: I1560d470a7511413b6198e269640c8d031e045fd
2016-01-22 11:11:44 +08:00
ting.wang 2bc625399f Using dict.items() is better than six.iteritems(dict)
Replacing dict.iteritems()/.itervalues() with
six.iteritems(dict)/six.itervalues(dict) was preferred in the past,
but there was a discussion suggesting to avoid six for this[1].
The overhead of creating a temporary list on Python 2 is negligible.

[1]http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Partially-implements blueprint py3-compatibility

Change-Id: Ia2298733188b3d964d43a547504ede2ebeaba9bd
2016-01-19 22:22:48 +08:00
LiuNanke 85082c5782 Clean up removed hacking rule from [flake8] ignore lists
We bump hacking>=0.10.0, and hacking removed some rules, for
the full list of rules please see [1]. So don't need them any more.

Hacking related commits:
Remove H904 in commit b1fe19ebebe47a36b905d709467f5e82521bbd96
Add H105 using author tags
Add H238 hacking no old style class
Add H501 hacking no locals
[1]https://github.com/openstack-dev/hacking/blob/master/setup.cfg#L30

Change-Id: I6a1f3c3ef22be0962ffb81a5da5660837552e5d7
2016-01-14 23:27:17 +08:00
zhongjun f041606cb4 Do not allow to modify access for public share type
Now public share type can be removed project access, but when
listing access, manila returns 'Access list not available for public
share types'. It's weird for users experience.

We should check if a type is public and do not allow public share type
to modify project access.

APIImpact
When modifying access for public share type, API will return 409 and message:
"Invalid share type: Type access modification is not applicable to public
share type."

Change-Id: I94f580eeb7eef4263c631227cc3710eeae2b9706
Closes-Bug: #1490912
2015-12-08 17:07:50 +08:00
Valeriy Ponomaryov 2467ccf223 Add new URLs for APIs ported from extensions
After port of extensions to core API we need to rename their URLs.

So, rename URLs and bump microversion for it.
Make new URLs work only with new microversion(s) 2.7+
and old with old microversions 1.0-2.6.
Add separate API router for v2 API as now we should split v1 and v2
logic.
Also, move updated APIs under v2 directory that will be used by both
API routers - v1 and v2.

List of updated collections is following:
 - os-availability-zone -> availability-zones
 - os-services -> services
 - os-quota-sets -> quota-sets
 - os-quota-class-sets -> quota-class-sets
 - os-share-manage -> shares/manage
 - os-share-unmanage -> shares/%s/action

List of updated member actions is following:
 - os-share-unmanage/%(share_id)s/unmanage -> shares/%(share_id)s/action
 - types/%(id)s/os-share-type-access -> types/%(id)s/share_type_access

List of updated action names is following:
 - os-access_allow -> access_allow
 - os-access_deny -> access_deny
 - os-access_list -> access_list
 - os-reset_status -> reset_status
 - os-force_delete -> force_delete
 - os-migrate_share -> migrate_share
 - os-extend -> extend
 - os-shrink -> shrink

List of updated attribute names is following:
 - os-share-type-access -> share-type-access

Partially implements bp ext-to-core

Change-Id: I82f00114db985b4b3bf4db0a64191559508ac600
2015-12-01 12:15:06 +02:00