Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Bug 1191238
Browse files Browse the repository at this point in the history
Bugzilla Link https://bugzilla.redhat.com/show_bug.cgi?id=1191238
Allow domain to be specified in oo-admin-ctl-app
  • Loading branch information
tiwillia committed Feb 10, 2015
1 parent 77a2043 commit 4beed00
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion broker-util/oo-admin-ctl-app
Expand Up @@ -20,6 +20,8 @@ Options:
Login with OpenShift access (required)
-a|--app <application>
Application name (alphanumeric) (required)
-n|--domain <domain>
Domain name
-c|--command <command>
#{CTL_APP_COMMANDS} (required)
-b|--bypass
Expand All @@ -41,6 +43,7 @@ end
opts = GetoptLong.new(
["--login", "-l", GetoptLong::REQUIRED_ARGUMENT],
["--app", "-a", GetoptLong::REQUIRED_ARGUMENT],
["--domain", "-n", GetoptLong::REQUIRED_ARGUMENT],
["--command", "-c", GetoptLong::REQUIRED_ARGUMENT],
["--gear_uuid", GetoptLong::REQUIRED_ARGUMENT],
["--cartridge", GetoptLong::REQUIRED_ARGUMENT],
Expand All @@ -59,6 +62,7 @@ end

login = args["--login"]
app_name = args["--app"]
domain = args["--domain"]
command = args['--command']
bypass = args['--bypass']
gear_uuid = args['--gear_uuid']
Expand Down Expand Up @@ -88,7 +92,13 @@ unless user
puts "User #{login} not found."
exit 1
end
app = Application.find_by_user(user, app_name)

if domain
app = Application.find_by(:name => app_name, :domain_namespace => domain, :owner_id => user._id)
else
app = Application.find_by_user(user, app_name)
end

unless app
puts "Application #{app_name} for user #{login} not found."
exit 1
Expand Down

0 comments on commit 4beed00

Please sign in to comment.