Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-82278

`targetcli restoreconfig` on non-existing file returns 0/success

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • rhel-9.6
    • targetcli
    • None
    • No
    • Low
    • rhel-storage-io-2
    • ssg_platform_storage
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      # targetcli restoreconfig xxx
      Restore file xxx not found
      # echo $?
      0
      

      An attempt to restore non-existing or unreadable file should return proper error code to be fully usable in scripts. This works as expected when there's a failure with JSON parsing:

      # targetcli restoreconfig /etc/fstab
      Expecting value: line 1 column 1 (char 0)
      # echo $?
      1
      

      targetcli-2.1.58-4.fc42.noarch
      targetcli-2.1.57-2.el9.noarch

              mlombard@redhat.com Maurizio Lombardi
              tbzatek Tomáš Bžatek
              Maurizio Lombardi Maurizio Lombardi
              Zhaojuan Guo Zhaojuan Guo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: