one icon indicating copy to clipboard operation
one copied to clipboard

oncfg fails to upgrade configuration if section is removed

Open xorel opened this issue 1 year ago • 0 comments

Description oncfg fails to upgarde a config

  • if a section such as TM_MAD_CONF/fs_lvm or VM_MAD_CONF/vcenter is removed (or commented out) in oned.conf
  • and if there is a patch changing this section in onecfg migrator such as in 6.6.0_to_6.8.0.yaml
    "/etc/one/oned.conf": 
        -   path:
            - TM_MAD_CONF
            - '"fs_lvm"'
            key: DISK_TYPE
            value: '"BLOCK"'
            state: ins

Applying the migrator will fails

# onecfg upgrade
ANY   : Found backed up configuration to process!
ANY   : Snapshot to update from '/var/lib/one/backups/config/2024-02-27_09:11:20-v6.6.3'
ANY   : Backup stored in '/var/lib/one/backups/config/2024-02-27_09:12:51_10410'
ERROR : Error updating file '/etc/one/oned.conf'
FATAL : ** TERMINATING UPDATE WITHOUT CHANGING SYSTEM ** Can't process files due to a fatal error (OneCfg::Config::Exception::PatchPathNotFound, desc. 'Patch path 'TM_MAD_CONF/"fs_lvm"' not found'). Use --verbose/--debug modes to get more information.
FATAL : FAILED - Patch path 'TM_MAD_CONF/"fs_lvm"' not found

Expected behavior Patch is skipped, perhaps a warning is written to update the section manually if is commented out

Details

  • Affected Component: onecfg
  • Version: all

Progress Status

  • [ ] Code committed
  • [ ] Testing - QA
  • [ ] Documentation (Release notes - resolved issues, compatibility, known issues)

xorel avatar Feb 27 '24 11:02 xorel