Commit Graph

27 Commits

Author SHA1 Message Date
ashrod98 47e7c78f37 Conditional Import for FIPS Compliance
Conditionally Import Parakimo
Separate SSH functions into ssh_utils.py for safe conditional import.

Change-Id: Ia1a3ee69bef76b52e4e6df1e73488c018ac0f3c9
2024-02-06 20:30:39 +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
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
digvijay2016 32a5a088a9 GPFS: Changing default value of NFS server type
Spectrum Scale provide NFS service with Ganesha server
by default (protocol node). So altering the default value
of NFS server for easiness.

Implements: blueprint gpfs-nfs-server-type-default-value-change

Change-Id: I2e3adeca58505c2da4a5675f7342bb2a174078cc
2017-06-08 12:36:51 +05:30
digvijay2016 e90dd3d711 GPFS Path: Fix bugs related to initialization of GPFS Driver
Due to lack of GPFS path ('/usr/lpp/mmfs/bin/') export, driver
is not able to find the GPFS commands causing the initialization
failure.
With this patch, GPFS will be able to run all GPFS commands
irrespective of GPFS path export.

Change-Id: I1aa8baf884dfaa42c37e575f0b6e1317f18543a1
Closes-bug: #1690785
2017-05-23 12:39:42 +05:30
Mark Sturdevant cbda16bc57 GPFS: Add update_access()
Add update_access() implementation to replace the deprecated
allow_access() and deny_access().

Change-Id: I206f1284bddc02452087e24061619ca3c04395a4
Implements: blueprint gpfs-update-access
2016-12-30 13:16:07 -08:00
digvijay2016 fb4b0b86e9 Add support for manage/unmanage in GPFS driver
Added support for manage/unmanage in GPFS NFS driver.
This patch added functions that allow share on Spectrum Scale
node to be managed by OpenStack if existing fileset is an
independent fileset and doesn't have any NFS export
over the fileset path. Also, share can be unmanaged from
OpenStack but still left in Spectrum Scale cluster.

Implements: blueprint gpfs-manage-support

Change-Id: I9134408b59c30ac4bc593f287294741f6e996136
2016-12-28 15:06:42 +05:30
Mark Sturdevant 9157b8afb2 GPFS KNFS: Fix deny access to succeed when possible
Use looser error code checking and add a verify
after deny access so that the call will succeed
whenever it can be confirmed that the access no
longer exists.

This fixes a variety of situations where previously
a return code of 1 while attempting to remove access
would cause the manila access rule to get stuck while
the actual client access export was removed or never
existed.

Change-Id: Ie058a6185e3f5d91fb1cf232301eb0ac6ddcea7e
Closes-Bug: #1651587
2016-12-23 01:17:20 +00:00
Mark Sturdevant b76a2af237 GPFS KNFS: Do not reuse ssh prefix in loop
Fix GPFS KNFS allow/deny access so that it does not reuse
the ssh prefix when looping through NFS server commands for
allow and deny access.

This fixes GPFS KNFS allow/deny access incorrect behavior
when multiple NFS servers are configured (gpfs_nfs_server_list)
and any of the servers are remote (except the last one).

Change-Id: I8c182eed386e8325b087c3192d363502bb848633
Closes-Bug: #1651578
2016-12-21 15:33:48 -08:00
Mark Sturdevant 5e7323cd1f GPFS CES: Fix bugs related to access rules not found
Several bugs are caused by an error code and
exception raised when a path has no NFS exports.
Use the machine-readable mmnfs export list command
(the -Y option) which does not cause an exception
when checking for exports.

Co-Authored-By: digvijay2016 <digvijay.ukirde@in.ibm.com>

Change-Id: I770756e0a36c5b61386878164b651fadf9730b7f
Closes-Bug: #1650043
Closes-Bug: #1650044
Closes-Bug: #1650045
2016-12-16 11:23:04 -08:00
zhangyanxian cc6428cedb Fix typo in test_gpfs.py
TrivialFix

Change-Id: Ia60a1a9d743e4c14592e53775a1fa200885cb569
2016-09-30 09:11:16 +00:00
Gaurang Tapase a91fa6e154 Refactor GPFS driver for NFS ganesha support
Spectrum Scale supports NFS ganesha through CES protocol services. This
change replaces the current NFS ganesha support with the Spectrum Scale
CES infrastructure.

Implements: blueprint gpfs-ces-support

Change-Id: I8eb307c19761788ea71c15c889794f8b5f110253
2016-08-10 04:47:20 -04:00
zhongjun 5dfc143909 QoS support for shares
QoS is a common attribute, so add the QoS
capability in common capabilities doc.
This is a simple first step towards what the
blueprints proposes.

Partially implements: bp manila-support-qos
Change-Id: I377bf0abcc62239c9a1a5ee5c28c336b2b6c410a
2016-01-15 10:15:50 +08:00
yangyapeng fe1071267b Use assertTrue/False instead of assertEqual(T/F)
The usage of assertEqual(True/False, ***) should be changed
to a meaningful format of assertTrue/False(***).
This patch fixes the same in Manila.

Change-Id: I0623c17a939e5175c15986dc7b6b64114c346c78
Closes-Bug: #1512207
2015-10-28 11:08:10 -04:00
Gaurang Tapase 838eae240d Add IBM GPFS Manila driver
Adding GPFS driver back as the third party CI system
for GPFS driver is up and running.

This is a revert of commit 720ec90445

Change-Id: I86f9b7da21716346f96bae3ce30446589e4c4c37
2015-10-18 08:31:59 -04:00
Ben Swartzlander 720ec90445 Remove IBM GPFS driver due to lack of CI
The Manila community set a deadline of 3 Sep 2015 for all drivers
to have reporting CI systems, and there is no CI system for the
IBM GPFS driver. As agreed, the driver will be removed until such
time that a CI system exists.

Change-Id: I76f238a1a6eb039e4ddc1cb189115ab3e686c56b
2015-09-15 16:36:08 -04:00
Gaurang Tapase 6aae96c527 Adding extend share support in IBM GPFS Driver
This change helps extend the size of the share by
changing the quota on GPFS fileset created for
that share.

Change-Id: I8076200b1350feadbb782ccd330e477c6edd52aa
Closes-Bug: #1481180
2015-08-12 03:28:24 -04:00
Valeriy Ponomaryov 6abb30299b Fix unit tests for compatibility with new mock==1.1.0
After release of mock==1.1.0 lib some our tests became incompatible.
Newest 'mock' lib does not have silent errors anymore and now our such errors
are discovered. So, fix them.

Change-Id: Ibb0e03f3b86e25201b7a888560ff133ebc627722
Closes-Bug: #1473350
2015-07-10 12:30:35 +03:00
Igor Malinovskiy 94e8c921db Remove passing DB reference to drivers in Share Manager
- Remove passing DB reference to drivers in __init__() method
- Remove db reference from Generic driver and service_instance
- Remove db reference from Netapp share driver
- Remove db reference from Glusterfs share driver
- Remove db reference from Glusterfs_Native share driver
- Remove db reference from Quobyte share driver
- Remove db reference from IBM GPFS driver
- Remove db reference from HDS_SOP driver
- Remove db reference from HDFSNative driver
- Remove db reference from fake driver
- Remove db reference from unit tests.

Change-Id: I74a636a8897caa6fc4af833c1568471fe1cb0987
2015-04-21 17:23:13 +03:00
Nilesh Bhosale fe51a03874 Improve error handling in GPFS driver
Improving the error handling and error messages as follows:
- Check for exit status for the commands executed over SSH
- Following Log Translation guidelines

Change-Id: Ide6a37d9c00062ce4b025063da97f2e236c4f986
Closes-Bug: #1420739
2015-03-05 11:02:58 +05:30
Clinton Knight 65d1158526 Replace legacy StubOutForTesting class
The Manila test module uses a class called StubOutForTesting, which
is an awkward holdover from when the unit tests were using Mox.
Alex wrote a more elegant and capable mocker method,
manila.test.TestCase.mock_object, in the Cinder project which we
have now added to Manila. So to remove the duplicate functionality
and legacy code, all references to self.stubs.Set() in the Manila
tests should be replaced with self.mock_object() and any related
dead code should be removed.

Resolves-bug: #1415602
Change-Id: Ie5f203c0b2cb57ad00d9ec8db0529075b6fef261
2015-02-03 14:31:17 +00:00
chen-li 7b050b8932 Remove startswith for share_proto check
We have explicit definition for supported share protocols.
Using "startswith" to search for substring is not a right way.

Change-Id: I8f482aea74249efca3bd490d971cf3e944919bb8
2015-01-30 08:27:44 +00:00
chen-li 7623504203 Remove copy-pasted code for fake-share
There are amounts of copy-pasted code for fake separated
in different files, they should be put in one place.

This patch moves the following into module fake_share:
    * fake_share
    * fake_snapshot
    * fake_access

Partial-Bug: #1416285

Change-Id: I78e7fc56c80ee19a8c01c5f37b428f019aa47e58
2015-01-30 16:23:03 +08: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 b719d0ffa6 Replace string driver modes with boolean value
Due to unclear meanings of existing names for share drivers modes it was
decided to replace string driver modes with boolean value, since we have only
two possible values that will clearly say what it used for by name of opt.

This replacement includes following changes:
- String opt 'share_driver_mode' is replaced with
bool opt 'driver_handles_share_servers'. New bool opt does not have
default value and should be defined explicitly.
- Class ShareDriver (parent class for share drivers) now expects additional
argument 'driver_handles_share_servers' which is mandatory and should be
provided by child classes. Expected values are boolean or tuple/list/set of
booleans that says what modes are supported. Above new config opt will be
compared to these.
- Update interfaces 'setup_server' and 'teardown_server' of class ShareDriver.
These interfaces now consider driver modes and call new additional private
methods only when driver is enabled to mode with share servers handling.
These new private methods are '_setup_server' and '_teardown_server', they
should be redefined by child classes when share servers should be handled by
Manila.
- To get know current driver mode within child classes just call property
'driver_handles_share_servers'. It can not be changed by child classes and
returns value that is set by config opt with same name.
- Remove methods 'setup_server' and 'teardown_server' from all share drivers,
that do not support handling of share servers.
- Rename methods 'setup_server' and 'teardown_server' to appropriate
private methods for drivers that do support handling of share servers.
- Update unit tests related to all changed places.
- Make Devstack set new mandatory bool opt.

Implements bp rename-driver-modes

Change-Id: I33402959bc4bbc34cfd4d7308ad0a7bcff3669b5
2015-01-22 10:47:40 +00:00
Ponomaryov Valeriy a9c25274ab Add driver mode attr definition for all drivers
Driver mode functionality was implemented to be able to specify how
driver should work and filter backends scheduling share creation based on this.
Add to all drivers update of attr 'mode' based on its current behavior.

Set 'share_driver_mode' extra spec to volume/share type with one of available
values. Scheduler will use it for host filtering.

Implements blueprint driver-modes-for-scheduler

Change-Id: Ida644f630ee07c51c02aea5d6280980b5d704c2f
2015-01-05 18:40:30 +00:00
Nilesh Bhosale f45df7f02b Adding GPFS Manila driver
Supporing GPFS exports over kernel NFS and Ganesha NFS
Supporting following Manila functionality:
1. Create, List, Delete Shares
2. Create, List, Delete Share Snapshots
3. Create Share from a Share Snapshot
4. Allow, Deny access to a share based on IP

Supports, local and remote GPFS nodes to the Manila service node,
in a GPFS cluster

Limitation:
1. While using remote GPFS node, with Ganesha NFS, 'gpfs_private_key'
for remote login to the GPFS node must be specified and there must be
a passwordless authentication already setup between the Manila and the
remote GPFS node.

DocImpact

Implements: blueprint gpfs-driver
Change-Id: I6664054ba52d03814cea846cb0d79cd853632814
2014-11-10 20:32:03 +05:30