HomeClusterLabs Projects

Refactor: Functionize --create[-empty], --reset in crm_shadow

Description

Refactor: Functionize --create[-empty], --reset in crm_shadow

Make main() more readable and maintainable. Also remove the now-dead
code from main(). We're doing all three of these simultaneously because
they're so similar.

There is a slight behavior change: the reset command can now be forced
if the shadow file does not exist. By default (without --force), it
requires that the shadow file already exist. With --force, it will
create the file if it doesn't exist.

This is better aligned with the existing behavior of create and
create_empty: those require that the file not already exist, unless
--force is supplied, in which case they overwrite the file.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Feb 28 2023, 1:23 AM
Parents
rPfbcc8ce8a0d5: Refactor: tools: Functionize --commit in crm_shadow
Branches
Unknown
Tags
Unknown