Bug 860913

Summary: [US2817][fork] Snapshot app save/restore fails with old command "rhc app snapshot"
Product: OKD Reporter: Jianwei Hou <jhou>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: ffranz, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fork_ami_BZ860913 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-06 18:50:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jianwei Hou 2012-09-27 05:27:08 UTC
Description of problem:
Take snapshot of an application with old command "rhc app snapshot", command fails  with "Too many arguments passed in" , but it should still work since we have alias for it, or will it be totally removed?

Version-Release number of selected component (if applicable):
On fork_ami_US2597_US2599_US2813_US2817_US2872_172

How reproducible:
Always

Steps to Reproduce:
1. Create an app
2. Snapshot app with 'rhc app snapshot', command fails with "Too many arguments passed in"  
  
Actual results:
hjw@my apps$ rhc app snapshot save -a app1 -f app1.tar.gz -px -d
D, [2012-09-27T13:01:42.278441 #7838] DEBUG -- : Connecting to https://ec2-23-20-246-48.compute-1.amazonaws.com/broker/rest/api
D, [2012-09-27T13:01:43.524667 #7838] DEBUG -- : Getting all domains
D, [2012-09-27T13:01:43.524899 #7838] DEBUG -- : Request: #<RestClient::Request:0x00000002e60aa8 @method="GET", @headers={:accept=>:json, "Authorization"=>"Basic amhvdUByZWRoYXQuY29tOng=", "User-Agent"=>"rhc/0.99.3 (ruby 1.9.3; x86_64-linux)"}, @url="https://ec2-23-20-246-48.compute-1.amazonaws.com/broker/rest/domains", @cookies={}, @payload="", @user=nil, @password=nil, @timeout=nil, @open_timeout=nil, @raw_response=false, @verify_ssl=false, @ssl_client_cert=nil, @ssl_client_key=nil, @ssl_ca_file=nil, @tf=nil, @processed_headers={"Accept"=>"application/json", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic amhvdUByZWRoYXQuY29tOng=", "User-Agent"=>"rhc/0.99.3 (ruby 1.9.3; x86_64-linux)", "Content-Length"=>"0", "Content-Type"=>"application/x-www-form-urlencoded"}, @args={:url=>"https://ec2-23-20-246-48.compute-1.amazonaws.com/broker/rest/domains", :method=>"GET", :headers=>{:accept=>:json, "Authorization"=>"Basic amhvdUByZWRoYXQuY29tOng=", "User-Agent"=>"rhc/0.99.3 (ruby 1.9.3; x86_64-linux)"}, :payload=>{}, :timeout=>nil}>
Too many arguments passed in.

Usage: rhc snapshot restore <application>

Restores a previously saved snapshot.

Options for snapshot restore
  -n, --namespace namespace Namespace of the application you are port forwarding to
  -f, --filepath filepath   Local path to save tarball (default: ./$APPNAME.tar.gz)
  -a, --app app             Application you are port forwarding to (required)

Global Options
  -l, --rhlogin login       OpenShift login
  -p, --password password   OpenShift password
  -d, --debug               Turn on debugging
  --noprompt                Do not ask for input
  --config FILE             Path of a different config file
  -h, --help                Display help documentation
  -v, --version             Display version information
  -t, --trace               Display backtrace when an error occurs


Tried to snapshot save an app, but messages returns a restore instruction.

Expected results:
Now that 'rhc app snapshot' is an alias of 'rhc snapshot', it should run successfully.

Additional info:
Both the following command syntaxs failed 
rhc app snapshot save -a app1 -f app1.tar.gz
rhc app snapshot save app1 -f app1.tar.gz

Same problems also happened with 'rhc app snapshot restore'

Comment 1 Fabiano Franz 2012-09-28 03:31:41 UTC
Fixed in fork_ami_BZ860913.

Comment 2 Jianwei Hou 2012-09-28 09:42:34 UTC
Verified on fork_ami_BZ860913

Steps:
1. create an app
2. Snapshot app with 'rhc app snapshot save' command
3. make some change to app and git push
4. restore app with 'rhc app snapshot restore' command

Result:
rhc app snapshot save/restore [-a] appname -f app1.tar.gz works without errors.