ClusterLabs / ClusterLabs/crmsh
`crm configure` requires both `deprecated` and `obsoletes` params
- Dominant language
- Python
- Stars
- 143
- Forks
- 96
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 16
Description
If a resource's metadata contains a deprecated param (`deprecated="1"`) and a new one that obsoletes it, and both params have `required="1"`, then `crm configure` requires both parameters. This is unexpected behavior. Only one or the other param should be specified in the CIB.
Example/reproducer:
```
# rpm -q crmsh fence-agents-vmware-soap redhat-release-server
crmsh-3.0.0-6.1.noarch
fence-agents-vmware-soap-4.0.11-86.el7.x86_64
redhat-release-server-7.5-8.el7.x86_64
# crm configure
crm(live)configure# primitive vmfence stonith:fence_vmware_soap \
> params ipaddr=1.2.3.4 login=fence_user passwd=secret_pass pcmk_host_map="node1:node-1;node2:node-2"
crm(live)configure# commit
ERROR: vmfence: required parameter ip not defined
ERROR: vmfence: required parameter username not defined
ERROR: vmfence: required parameter plug not defined
Do you still want to commit (y/n)? n
crm(live)configure# quit
bye
# crm configure
crm(live)configure# primitive vmfence stonith:fence_vmware_soap \
> params ip=1.2.3.4 username=fence_user passwd=secret_pass plug=dummy_val pcmk_host_map="node1:node-1;node2:node-2"
crm(live)configure# commit
ERROR: vmfence: required parameter ipaddr not defined
ERROR: vmfence: required parameter login not defined
Do you still want to commit (y/n)? n
crm(live)configure# quit
bye
# /usr/sbin/fence_vmware_soap -o metadata | egrep 'name="(ip|ipaddr|login|username|plug|pcmk_host_list)"'
```
If the problem is that the `deprecated` and `obsoletes` params should not both have `required="1"`, then I can open an issue or BZ against `fence-agents`.
A secondary, closely related concern is that this tool requires `plug`, when `pcmk_host_map` should take care of that requirement. I am likewise unsure here whether the issue should be against crmsh (for metadata parsing) or fence-agents (for metadata output).
Contributor guide
Research direction
Start by reproducing the `crm configure` examples with the fence_vmware_soap metadata shown in the issue, then trace crmsh's metadata parsing and validation of `required`, `deprecated`, and `obsoletes` parameters. Done means the CIB accepts either the deprecated or replacement parameter without requiring both, with the related `plug` and `pcmk_host_map` behavior clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100