Bug 1308716 - rhc snapshot save different app with the same name in the same dir didn't prompt conflict information
Summary: rhc snapshot save different app with the same name in the same dir didn't pr...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 2.2.0
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Vu Dinh
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On: 1141093
Blocks: 1139608
TreeView+ depends on / blocked
 
Reported: 2016-02-15 21:01 UTC by Vu Dinh
Modified: 2016-03-22 16:54 UTC (History)
14 users (show)

Fixed In Version: rhc-1.38.6.1-1.el6op
Doc Type: Bug Fix
Doc Text:
Cause: rhc snapshot doesn't check if the file already exists and then warns user before overwriting the file during the process of creating snapshot file. Consequence: The previous snapshot file with the same name will be overwritten without any warnings from the rhc snapshot command. Fix: A new check is added to rhc snapshot to verify if the file with the same name already exists in the directory or not. If it does, prompt to user to ask if he/she wants to overwrite the file or not. Result: rhc snapshot will not overwrite the already existed file unless the user allows it to do so.
Clone Of: 1141093
Environment:
Last Closed: 2016-03-22 16:54:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0489 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.9 security, bug fix, and enhancement update 2016-03-22 20:49:04 UTC

Description Vu Dinh 2016-02-15 21:01:43 UTC
+++ This bug was initially created as a clone of Bug #1141093 +++

+++ This bug was initially created as a clone of Bug #1139608 +++

Description of problem:
 
rhc snapshot save a app with the name a.tar.gz in /root/desktop dir, snapshot save another app with the same name a.tar.gz in /root/desktop dir, system didn't prompt conflict information

Version-Release number of selected component (if applicable):
rhc 1.29.3.1

How reproducible:
always

Steps to Reproduce:
1.rhc snapshot save app -f 'a.tar.gz'
2.rhc snapshot save app2 -f 'a.tar.gz'

Actual results:
after step 1~2, prompt conflict information

Expected results:
after step 1~2, didn't prompt conflict information , cover the first file.

Additional info:


Tested on STG(devenv-stage_1006), same issue in OpenShift Online

--- Additional comment from Vu Dinh on 2015-11-25 14:53:08 EST ---

The description for this bug doesn't match the Actual/Expected results section. I believe they are switched. It should be like this instead:

Actual results:
after step 1~2, didn't prompt conflict information , cover the first file.

Expected results:
after step 1~2, prompt conflict information

Thanks,
Vu

--- Additional comment from openshift-github-bot on 2015-12-03 10:46:53 EST ---

Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/f982979f0c198dbb5992439ffb340a9deacaae7b
Bug 1141093 - rhc snapshot save same filename didn't prompt conflict warning

The 'rhc snapshot save -f' command overwrites existing file without warning
if user inputs same filename for two different apps.

This commit modifies the rhc snapshow command to verify if the file already
exists and ask user for confirmation before proceeding.

Bug 1141093
Link <https://bugzilla.redhat.com/show_bug.cgi?id=1141093>

Signed-off-by: Vu Dinh <vdinh>

--- Additional comment from Qixuan Wang on 2015-12-04 04:16:41 EST ---

Tested on devenv_5729, rhc-1.38.4, I agree with your comment 1, that sounds more reasonable. The bug has been fixed, thanks.

Here is the result:

[root@qwang test]# rhc snapshot save py26 -f 'app.tar.gz'
Pulling down a snapshot of application 'py26' to app.tar.gz ... done

[root@qwang test]# rhc snapshot save php54 -f 'app.tar.gz'
File app.tar.gz already exists. Do you want to overwrite this file? (yes|no): yes
Pulling down a snapshot of application 'php54' to app.tar.gz ... done

Comment 4 Qixuan Wang 2016-02-23 08:42:30 UTC
The bug https://bugzilla.redhat.com/show_bug.cgi?id=1311034 blocks the OSE v2 environment installation. I'm going to check the bug once environment ready.

Comment 6 Gaoyun Pei 2016-02-26 09:09:15 UTC
Verify with rhc-1.38.6.1-1.el6op.noarch

Make snapshot for two app with the same name:
[root@broker ~]# rhc snapshot save app1 -f 'test.tar.gz'
Pulling down a snapshot of application 'app1' to test.tar.gz ... done
[root@broker ~]# rhc snapshot save test1 -f 'test.tar.gz'
File test.tar.gz already exists. Do you want to overwrite this file? (yes|no): yes
Pulling down a snapshot of application 'test1' to test.tar.gz ... done

Check test.tar.gz, contains compressed files of test1 app.

Comment 8 errata-xmlrpc 2016-03-22 16:54:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-0489.html


Note You need to log in before you can comment on or make changes to this bug.