Introduce $CLUSTERSHELL_CFGDIR #483
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce
$CLUSTERSHELL_CFGDIR
as an alternate location for configuration files.This is basically a revisit of #191. This original issue led to #111, which allows per-user configuration file overrides, but doesn't provide a way to define system-wide configuration files (not per-user), which are not stored in
/etc
.The use case is a multi-node cluster, where ClusterShell could be provided as a user-facing tool, installed on a shared file system (like a NFS mount point), and not as a local package on each node. In that case, providing system defaults for all users would requiring distributing configuration files on each and every of the cluster node's local
/etc/
directory. A more flexible approach would be to define an environment variable (the proposed$CLUSTERSHELL_CFGDIR
) to point to the global configuration directory, which could be co-located with the shared ClusterShell installation.When
$CLUSTERSHELL_CFGDIR
is not defined, the default/etc/clustershell
is used as a fallback to keep compatibility with existing configurations.This PR:
lib/ClusterShell/Defaults.py
doc/
tests/CLIConfigTest.py