Skip to content

Commit

Permalink
overhaul pcs property config | describe | defaults commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mirecheck authored and tomjelinek committed May 17, 2023
1 parent d51338f commit d5642c2
Show file tree
Hide file tree
Showing 47 changed files with 2,985 additions and 1,092 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,7 +5,13 @@
### Added
- Automatic restarts of the Puma web server in the legacy Ruby daemon to reduce
its memory footprint ([rhbz#2189958])
- Add `pcs property defaults` and `pcs property describe` CLI commands
- Support for output formats `json` and `cmd` to property config command
([rhbz#2166289])
- Commands `pcs resource describe` and `pcs stonith describe` print detailed
info about resource options (data type or allowed values, default value)

[rhbz#2166289]: https://bugzilla.redhat.com/show_bug.cgi?id=2166289
[rhbz#2189958]: https://bugzilla.redhat.com/show_bug.cgi?id=2189958


Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Expand Up @@ -2,6 +2,10 @@
mypy_path = ./pcs/bundled/packages

# Modules and packages with full support have more strict checks enabled
[mypy-pcs.cli.cluster_property]
disallow_untyped_defs = True
disallow_untyped_calls = True

[mypy-pcs.cli.common.printable_tree]
disallow_untyped_defs = True
disallow_untyped_calls = True
Expand Down
10 changes: 6 additions & 4 deletions pcs/Makefile.am
Expand Up @@ -23,9 +23,11 @@ EXTRA_DIST = \
cli/booth/command.py \
cli/booth/env.py \
cli/booth/__init__.py \
cli/cluster/command.py \
cli/cluster/__init__.py \
cli/cluster_property.py \
cli/cluster/command.py \
cli/cluster_property/__init__.py \
cli/cluster_property/command.py \
cli/cluster_property/output.py \
cli/common/capabilities.py \
cli/common/completion.py \
cli/common/env_cli.py \
Expand Down Expand Up @@ -103,13 +105,14 @@ EXTRA_DIST = \
common/interface/__init__.py \
common/node_communicator.py \
common/pacemaker/__init__.py \
common/pacemaker/cluster_property.py \
common/pacemaker/defaults.py \
common/pacemaker/nvset.py \
common/pacemaker/resource/__init__.py \
common/pacemaker/resource/bundle.py \
common/pacemaker/resource/clone.py \
common/pacemaker/resource/list.py \
common/pacemaker/resource/group.py \
common/pacemaker/resource/list.py \
common/pacemaker/resource/operations.py \
common/pacemaker/resource/primitive.py \
common/pacemaker/resource/relations.py \
Expand Down Expand Up @@ -322,7 +325,6 @@ EXTRA_DIST = \
node.py \
pcsd.py \
pcs_internal.py \
prop.py \
qdevice.py \
quorum.py \
resource.py \
Expand Down
15 changes: 8 additions & 7 deletions pcs/acl.py
@@ -1,7 +1,4 @@
from pcs import (
prop,
utils,
)
from pcs.cli.cluster_property.output import PropertyConfigurationFacade
from pcs.cli.common.errors import CmdLineInputError
from pcs.cli.reports.output import warn
from pcs.common.str_tools import indent
Expand Down Expand Up @@ -36,10 +33,14 @@ def acl_config(lib, argv, modifiers):
modifiers.ensure_only_supported("-f")
if argv:
raise CmdLineInputError()
properties = utils.get_set_properties(
defaults=prop.get_default_properties()

properties_facade = PropertyConfigurationFacade.from_properties_dtos(
lib.cluster_property.get_properties(),
lib.cluster_property.get_properties_metadata(),
)
acl_enabled = properties_facade.get_property_value_or_default(
"enable-acl", ""
)
acl_enabled = properties.get("enable-acl", "").lower()
if is_true(acl_enabled):
print("ACLs are enabled")
else:
Expand Down
68 changes: 0 additions & 68 deletions pcs/cli/cluster_property.py

This file was deleted.

Empty file.

0 comments on commit d5642c2

Please sign in to comment.