diff --git a/targetcli-fb.changes b/targetcli-fb.changes index 556b496..f08ef39 100644 --- a/targetcli-fb.changes +++ b/targetcli-fb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Apr 20 19:13:39 UTC 2018 - lduncan@suse.com + +- Only save current config to backup if current + config exists (bsc#1090424), adding patch: + * targetcli-only-save-old-config-if-present.patch + ------------------------------------------------------------------- Wed Apr 11 00:00:54 UTC 2018 - ddiss@suse.com diff --git a/targetcli-fb.spec b/targetcli-fb.spec index 52bbfad..69d8c4a 100644 --- a/targetcli-fb.spec +++ b/targetcli-fb.spec @@ -58,6 +58,7 @@ Patch1: Auto-detect-readonly-state-for-iblock-devices.patch Patch2: Use-signed-char-instead-of-char.patch Patch3: Split-out-blockdev-readonly-state-detection-helper.patch Patch4: rbd-support.patch +Patch5: targetcli-only-save-old-config-if-present.patch %python_subpackages @@ -89,6 +90,7 @@ python2-targetcli-fb and python3-targetcli-fb. # RBD support is dependent on LIO changes present in the SLE/Leap kernel %patch4 -p1 %endif +%patch5 -p1 %build %python_build diff --git a/targetcli-only-save-old-config-if-present.patch b/targetcli-only-save-old-config-if-present.patch new file mode 100644 index 0000000..83b9180 --- /dev/null +++ b/targetcli-only-save-old-config-if-present.patch @@ -0,0 +1,23 @@ +From: Lee Duncan +Date: Fri Apr 20 12:07:30 PDT 2018 +Subject: [PATCH] targetcli: only save old config if present + +There is no reason to copy the current configuration to the +backup directory if there is no current configuration. + +Already fixed upstream, but the code is totally different +there. + +Signed-off-by: Lee Duncan +--- +--- a/targetcli/ui_root.py 2018-04-20 11:53:58.987907240 -0700 ++++ b/targetcli/ui_root.py 2018-04-20 11:56:35.231375345 -0700 +@@ -70,7 +70,7 @@ class UIRoot(UINode): + savefile = os.path.expanduser(savefile) + + # Only save backups if saving to default location +- if savefile == default_save_file: ++ if (savefile == default_save_file) and os.path.exists(savefile): + backup_dir = os.path.dirname(savefile) + "/backup" + backup_name = "saveconfig-" + \ + datetime.now().strftime("%Y%m%d-%H:%M:%S") + ".json"