Commit Graph

9 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
Victoria Martinez de la Cruz f32be69fc4 Refactor the Ceph NFS driver to use Cephadm NFS
CephAdmNFSProtocol helper has been added to allow users to consume NFS clusters
deployed using cephadm. This presents many advantages, since the operator
no longer needs to maintain their own instances of NFS Ganesha apart of the
Ceph cluster. For this, we now communicate with ceph mgr using
the nfs plugin. Read more about this plugin in
https://docs.ceph.com/en/latest/cephfs/nfs/

Implements: bp/use-cephadm-nfs-ganesha

DocImpact

Change-Id: I1826f2970528928a31b32a664013380e38bbd7c9
2022-09-07 15:44:45 +00:00
Tom Barron 9df750fd19 Only allow IP access type for CephFS NFS
For the CephFS NFS back end only ``IP`` access type
is valid so enforce this in the driver.

Also validate access level since there is a utility
routine to check both access type and access level.

Closes-bug: #1816420
Change-Id: I6c96f861b30ef7ccac05a7c199a62f0d69044c3a
2019-03-20 18:42:01 -04:00
Tom Barron a65c2b0974 Fix ganesha for 0.0.0.0/0 access
Translate '0.0.0.0/0' to '0.0.0.0' when allowing IP
access with the ganesha driver since the ganesha back end
cannot handle the former expression and the latter has
the desired effect of allowing access to all IPs.

Closes-bug: #1800627

Change-Id: Ica698b6a70a128522c2c2de76a69e59207fd60ac
2018-11-26 12:48:18 +00:00
Csaba Henk bde7105a5b ganesha: implement update_access
As with Ganesha there is no direct way to
bulk process a set of rules, in update_access()
we just call down to the old allow/deny methods
iteratively.

However, they got underscore prefixed:
{allow,deny}_access -> _{allow,deny}_access

The update_access method has the

  update_access(base_path, share, add_rules, delete_rules, recovery_mode)

interface. Drivers using a ganesha.NASHelperBase derived
helpers and implementing the

  update_access(..., access_rules, add_rules, delete_rules, ...)

interface should decide about recovery mode by access_rules
content and pass down either access_rules or add_rules
to the helper's update_rules as add_rules (respectively in recovery
and normal mode, and also setting the recovery_mode flag
appropriately). The driver is also responsible for checking
the validity of the rules, for which we add support
by the NASHelperBase

  supported_access_types
  supported_access_levels

attributes and the utils._get_valid_access_rules utility
method.

Co-Authored-By: Ramana Raja <rraja@redhat.com>
Implements bp ganesha-update-access

Change-Id: Iea3a3ce3db44df792b5cf516979ff79c61d5b182
2016-06-13 19:29:10 +02: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
Martin Kletzander 199692d6ff Fix common misspellings
Wikipedia's list of common misspellings [1] has a machine-readable
version.  This patch fixes those misspellings mentioned in the list
which don't have multiple right variants (as e.g. "accension", which can
be both "accession" and "ascension"), such misspellings are left
untouched.  The list of changes was manually re-checked for false
positives.

[1] https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines

Change-Id: I2446995aa8b7c89c7f78c056f9ddb6d8e7899e4e
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-03-23 14:41:41 +01:00
Ramana Raja 026483e374 ganesha utils: allow remote execution as root
Remote execute calls in the ganesha helpers are made using ganesha
utils's SSHExecutor object that uses  processutils's ssh_execute()
method. But processutils's ssh_execute() method unlike processutils's
execute() method does not accept an argument whose identifier is
'run_as_root=', necessary to execute commands with super user
privilege. So allow 'run as root' behavior in remote execution by
prepending 'sudo' to the command passed to processutils's ssh_execute()
method, in the SSHExecutor's __call__() method.

Change-Id: I3c9f9837b692b06bad15341d09ce5b7c4dfa7268
Closes-Bug: #1422255
2015-02-20 11:26:27 +05:30
Csaba Henk 559b478e85 ganesha: NFS-Ganesha instrumentation
Introduce the ganesha share driver helper module
which provides the GaneshaNASHelper class from which
share drivers can derive NFS-Ganesha backed protocol
helpers.

Some utility functions are also added to ease
integration.

Partially implements blueprint gateway-mediated-with-ganesha

Change-Id: I8683ea5eb43d7a8eaf0dfa6af3791782d32b944a
2014-12-18 15:49:33 +01:00