rhc 0.79.5 → 0.80.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rhc-create-app +4 -4
- data/bin/rhc-create-domain +3 -3
- data/bin/rhc-ctl-app +3 -3
- data/bin/rhc-snapshot +4 -1
- data/bin/rhc-user-info +5 -1
- data/lib/rhc-common.rb +9 -8
- metadata +4 -4
data/bin/rhc-create-app
CHANGED
@@ -32,7 +32,7 @@ def p_usage
|
|
32
32
|
Usage: #{$0}
|
33
33
|
Create an OpenShift Express app.
|
34
34
|
|
35
|
-
-a|--app application Application name (alphanumeric - max #{RHC::
|
35
|
+
-a|--app application Application name (alphanumeric - max #{RHC::APP_NAME_MAX_LENGTH} chars) (required)
|
36
36
|
-t|--type type Type of app to create (#{type_keys}) (required)
|
37
37
|
-l|--rhlogin rhlogin Red Hat login (RHN or OpenShift login with OpenShift Express access) (#{rhlogin})
|
38
38
|
-p|--password password RHLogin password (optional, will prompt)
|
@@ -281,7 +281,7 @@ sleep 15
|
|
281
281
|
# Now start checking for DNS
|
282
282
|
loop = 0
|
283
283
|
sleep_time = 2
|
284
|
-
while loop < RHC::
|
284
|
+
while loop < RHC::MAX_RETRIES && !RHC::hostexist?(fqdn)
|
285
285
|
sleep sleep_time
|
286
286
|
loop+=1
|
287
287
|
puts " retry # #{loop} - Waiting for DNS: #{fqdn}"
|
@@ -305,7 +305,7 @@ git_url = "ssh://#{app_uuid}@#{app_name}-#{namespace}.#{rhc_domain}/~/git/#{app_
|
|
305
305
|
# If the hostname couldn't be resolved, print out the git URL
|
306
306
|
# and exit cleanly. This will help solve issues where DNS times
|
307
307
|
# out in APAC, etc on resolution.
|
308
|
-
if loop >= RHC::
|
308
|
+
if loop >= RHC::MAX_RETRIES
|
309
309
|
puts <<WARNING
|
310
310
|
|
311
311
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
@@ -379,7 +379,7 @@ end
|
|
379
379
|
sleep_time = 2
|
380
380
|
attempt = 0
|
381
381
|
puts "Confirming application #{opt['app']} is available"
|
382
|
-
while attempt < RHC::
|
382
|
+
while attempt < RHC::MAX_RETRIES
|
383
383
|
attempt+=1
|
384
384
|
puts " Attempt # #{attempt}"
|
385
385
|
url = URI.parse("http://#{fqdn}/#{health_check_path}")
|
data/bin/rhc-create-domain
CHANGED
@@ -36,7 +36,7 @@ Bind a registered rhcloud user to a domain in rhcloud.
|
|
36
36
|
NOTE: to change ssh key, alter your openshift <id_rsa> and
|
37
37
|
<id_rsa>.pub keys, then re-run with --alter
|
38
38
|
|
39
|
-
-n|--namespace namespace Namespace for your application(s) (alphanumeric - max #{RHC::
|
39
|
+
-n|--namespace namespace Namespace for your application(s) (alphanumeric - max #{RHC::DEFAULT_MAX_LENGTH} chars) (required)
|
40
40
|
-l|--rhlogin rhlogin Red Hat login (RHN or OpenShift login with OpenShift Express access) (required)
|
41
41
|
-p|--password password RHLogin password (optional, will prompt)
|
42
42
|
-a|--alter Alter namespace (will change urls) and/or ssh key
|
@@ -187,14 +187,14 @@ EOF
|
|
187
187
|
# Now start checking for DNS
|
188
188
|
loop = 0
|
189
189
|
sleep_time = 2
|
190
|
-
while loop < RHC::
|
190
|
+
while loop < RHC::MAX_RETRIES && !RHC::hostexist?(fqdn)
|
191
191
|
sleep sleep_time
|
192
192
|
loop+=1
|
193
193
|
puts " retry # #{loop} - Waiting for DNS: #{fqdn}"
|
194
194
|
sleep_time = RHC::delay(sleep_time)
|
195
195
|
end
|
196
196
|
|
197
|
-
if loop >= RHC::
|
197
|
+
if loop >= RHC::MAX_RETRIES
|
198
198
|
puts "Host could not be found: #{fqdn}"
|
199
199
|
dns_success = false
|
200
200
|
end
|
data/bin/rhc-ctl-app
CHANGED
@@ -35,7 +35,7 @@ Control an OpenShift express app
|
|
35
35
|
-a|--app application Application name (alphanumeric) (required)
|
36
36
|
-l|--rhlogin rhlogin Red Hat login (RHN or OpenShift login with OpenShift Express access) (#{rhlogin})
|
37
37
|
-p|--password password RHLogin password (optional, will prompt)
|
38
|
-
-c|--command command (start|stop|restart|reload|status|destroy)
|
38
|
+
-c|--command command (start|stop|force-stop|restart|reload|status|destroy)
|
39
39
|
-L|--embedded-list List supported embedded cartridges
|
40
40
|
-e|--embed (add|remove|stop|start|restart|status|reload)-$cartridge eg: add-mysql-5.1
|
41
41
|
-b|--bypass Bypass warnings
|
@@ -121,8 +121,8 @@ unless opt["embed"] or opt["command"]
|
|
121
121
|
end
|
122
122
|
|
123
123
|
if opt["command"]
|
124
|
-
unless opt["command"] =~ /^(start|stop|restart|reload|status|destroy)$/
|
125
|
-
puts "Invalid command '#{opt["command"]}' specified. Valid commands are (start|stop|restart|reload|status|destroy)"
|
124
|
+
unless opt["command"] =~ /^(start|stop|force-stop|restart|reload|status|destroy)$/
|
125
|
+
puts "Invalid command '#{opt["command"]}' specified. Valid commands are (start|stop|force-stop|restart|reload|status|destroy)"
|
126
126
|
p_usage
|
127
127
|
end
|
128
128
|
elsif opt["embed"]
|
data/bin/rhc-snapshot
CHANGED
@@ -120,7 +120,10 @@ else
|
|
120
120
|
if File.exists? opt['restore']
|
121
121
|
`tar -tf #{opt['restore']} './*/#{app}'`
|
122
122
|
if $?.exitstatus != 0
|
123
|
-
puts "Archive at #{opt['restore']} does not contain the target application:
|
123
|
+
puts "Archive at #{opt['restore']} does not contain the target application: ./*/#{app}"
|
124
|
+
puts "If you created this archive rather than exported with rhc-snapshot, be sure"
|
125
|
+
puts "the directory structure inside the archive starts with ./<app_uuid>/"
|
126
|
+
puts "i.e.: tar -czvf <app_name>.tar.gz ./<app_uuid>/"
|
124
127
|
exit 255
|
125
128
|
else
|
126
129
|
`tar -tf #{opt['restore']} './*/git'`
|
data/bin/rhc-user-info
CHANGED
@@ -123,7 +123,11 @@ if opt['apps']
|
|
123
123
|
puts " Embedded: "
|
124
124
|
if val['embedded'] && !val['embedded'].empty?
|
125
125
|
val['embedded'].each do |embed_key, embed_val|
|
126
|
-
|
126
|
+
if embed_val.has_key?('info') && !embed_val['info'].empty?
|
127
|
+
puts " #{embed_key} - #{embed_val['info']}"
|
128
|
+
else
|
129
|
+
puts " #{embed_key}"
|
130
|
+
end
|
127
131
|
end
|
128
132
|
else
|
129
133
|
puts " None"
|
data/lib/rhc-common.rb
CHANGED
@@ -33,9 +33,10 @@ require 'uri'
|
|
33
33
|
|
34
34
|
module RHC
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
DEFAULT_MAX_LENGTH = 16
|
37
|
+
APP_NAME_MAX_LENGTH = 32
|
38
|
+
MAX_RETRIES = 7
|
39
|
+
DEFAULT_DELAY = 2
|
39
40
|
API = "1.1.1"
|
40
41
|
@mytimeout = 10
|
41
42
|
@mydebug = false
|
@@ -65,7 +66,7 @@ module RHC
|
|
65
66
|
end
|
66
67
|
end
|
67
68
|
|
68
|
-
def self.delay(time, adj=
|
69
|
+
def self.delay(time, adj=DEFAULT_DELAY)
|
69
70
|
(time*=adj).to_int
|
70
71
|
end
|
71
72
|
|
@@ -130,11 +131,11 @@ module RHC
|
|
130
131
|
end
|
131
132
|
|
132
133
|
def self.check_app(app)
|
133
|
-
check_field(app, 'application',
|
134
|
+
check_field(app, 'application', APP_NAME_MAX_LENGTH)
|
134
135
|
end
|
135
136
|
|
136
137
|
def self.check_namespace(namespace)
|
137
|
-
check_field(namespace, 'namespace',
|
138
|
+
check_field(namespace, 'namespace', DEFAULT_MAX_LENGTH)
|
138
139
|
end
|
139
140
|
|
140
141
|
def self.check_field(field, type, max=0)
|
@@ -143,8 +144,8 @@ module RHC
|
|
143
144
|
puts "#{type} contains non-alphanumeric characters!"
|
144
145
|
return false
|
145
146
|
end
|
146
|
-
if max != 0 && field.length >
|
147
|
-
puts "maximum #{type} size is #{
|
147
|
+
if max != 0 && field.length > max
|
148
|
+
puts "maximum #{type} size is #{max} characters"
|
148
149
|
return false
|
149
150
|
end
|
150
151
|
else
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 341
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 80
|
9
9
|
- 5
|
10
|
-
version: 0.
|
10
|
+
version: 0.80.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Red Hat
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-26 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json_pure
|