ClusterLabs / ClusterLabs/crmsh
enhancement: copy resources
- Dominant language
- Python
- Stars
- 143
- Forks
- 96
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 16
Description
When creating similar resources, on could `edit` (in `configure` context) the whole file using the editor to copy and then modify the desired resource.
As an alternative one could first `show` the resource to copy, and then re-create it with a new name and parameters adapted.
Both do not look like a good solution; therefore I suggest (for `configure` context):
As just copying a resource with parameters unchanged may violate some uniqueness restrictions, a command "`copy` *resource*" is problematic; instead extend the `edit` command for "`edit` [`copy`] *resource".
That command would create a new resource copying *resource* with `_copy` (or `-copy`) being appended to the original resource name, and it will start the editor (just as `edit` would do) to allow changing the resource name and the parameters as intended.
When adding the optional `xml` parameter, the XML version of the resource would be presented in the editor instead, so:
"`edit` [`xml`] [`copy`] ..."
Possibly also:
"`edit` [`xml`] [`copy`] `changed`"
Contributor guide
Research direction
Begin by locating the configure context's edit command and how it handles resource names, parameters, and the optional xml form. Done means the proposed copy-and-edit workflow is defined and implemented, including the copied name and the requested command variants.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100