rhc 1.37.1 → 1.38.4
Sign up to get free protection for your applications and to get access to all the features.
- data/features/app_feature.rb +12 -0
- data/lib/rhc/commands.rb +1 -1
- data/lib/rhc/commands/cartridge.rb +1 -1
- data/lib/rhc/core_ext.rb +2 -2
- data/lib/rhc/exceptions.rb +1 -1
- data/lib/rhc/git_helpers.rb +1 -1
- data/lib/rhc/helpers.rb +3 -1
- data/lib/rhc/output_helpers.rb +2 -2
- data/lib/rhc/rest/api.rb +2 -3
- data/lib/rhc/rest/client.rb +5 -0
- data/lib/rhc/tar_gz.rb +1 -1
- metadata +9 -17
data/features/app_feature.rb
CHANGED
@@ -11,6 +11,18 @@ describe "rhc app scenarios" do
|
|
11
11
|
let(:app){ @app }
|
12
12
|
|
13
13
|
it "should clone successfully" do
|
14
|
+
# The following works around an issue with strict host key checking.
|
15
|
+
# create-app --from-app uses SSH to copy the application. However,
|
16
|
+
# this test uses a new application, so without this workaround, create-app
|
17
|
+
# --from-app will be trying to log into the application for the first
|
18
|
+
# time, and so SSH will not recognize the host key and will prompt for
|
19
|
+
# confirmation, causing the test to hang and eventually time out. To work
|
20
|
+
# around the problem, we tell rhc to initiate an SSH connection using
|
21
|
+
# GIT_SSH (which disables strict host key checking), which will cause SSH
|
22
|
+
# to add the host to ~/.ssh/known_hosts, which will allow the subsequent
|
23
|
+
# create-app --from-app command to succeed.
|
24
|
+
rhc 'ssh', '--ssh', ENV['GIT_SSH'], app.name, '--', 'true'
|
25
|
+
|
14
26
|
app_name = "clone#{random}"
|
15
27
|
r = rhc 'create-app', app_name, '--from-app', app.name
|
16
28
|
r.stdout.should match /Domain:\s+#{app.domain}/
|
data/lib/rhc/commands.rb
CHANGED
@@ -147,7 +147,7 @@ module RHC::Commands
|
|
147
147
|
|
148
148
|
summary "Start a cartridge"
|
149
149
|
syntax "<cartridge> [--namespace NAME] [--app NAME]"
|
150
|
-
argument :cart_type, "The name of the cartridge you are
|
150
|
+
argument :cart_type, "The name of the cartridge you are starting", ["-c", "--cartridge cartridge"]
|
151
151
|
takes_application
|
152
152
|
alias_action :"app cartridge start", :root_command => true, :deprecated => true
|
153
153
|
def start(cartridge)
|
data/lib/rhc/core_ext.rb
CHANGED
data/lib/rhc/exceptions.rb
CHANGED
data/lib/rhc/git_helpers.rb
CHANGED
data/lib/rhc/helpers.rb
CHANGED
@@ -135,6 +135,7 @@ module RHC
|
|
135
135
|
global_option('--timeout SECONDS', Integer, 'The timeout for operations') do |value|
|
136
136
|
raise RHC::Exception, "Timeout must be a positive integer" unless value > 0
|
137
137
|
end
|
138
|
+
global_option '--always-auth', "Always use authentication when making OpenShift API requests.", :hide => true
|
138
139
|
global_option '--noprompt', "Suppress all interactive operations command", :hide => true do
|
139
140
|
$terminal.page_at = nil
|
140
141
|
end
|
@@ -200,7 +201,7 @@ module RHC
|
|
200
201
|
return nil if token_store_user_key.nil?
|
201
202
|
token_store.get(token_store_user_key, options.server)
|
202
203
|
end
|
203
|
-
|
204
|
+
|
204
205
|
def parse_headers(headers)
|
205
206
|
Hash[
|
206
207
|
Array(headers).map do |header|
|
@@ -217,6 +218,7 @@ module RHC
|
|
217
218
|
:headers => parse_headers(options.header),
|
218
219
|
:timeout => options.timeout,
|
219
220
|
:warn => BOUND_WARNING,
|
221
|
+
:api_always_auth => options.always_auth
|
220
222
|
}.merge!(ssl_options).merge!(opts))
|
221
223
|
end
|
222
224
|
|
data/lib/rhc/output_helpers.rb
CHANGED
@@ -66,7 +66,7 @@ module RHC
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def display_app_summary(applications)
|
71
71
|
section do
|
72
72
|
if !applications.nil? and !applications.empty?
|
@@ -79,7 +79,7 @@ module RHC
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
82
|
-
|
82
|
+
|
83
83
|
end
|
84
84
|
|
85
85
|
def display_app_configurations(rest_app)
|
data/lib/rhc/rest/api.rb
CHANGED
@@ -10,12 +10,11 @@ module RHC
|
|
10
10
|
@server_api_versions = []
|
11
11
|
debug "Client supports API versions #{preferred_api_versions.join(', ')}"
|
12
12
|
@client_api_versions = preferred_api_versions
|
13
|
-
always_auth = RHC::Helpers.to_boolean(RHC::Config['always_auth'], false)
|
14
13
|
@server_api_versions, @current_api_version, links = api_info({
|
15
14
|
:url => client.url,
|
16
15
|
:method => :get,
|
17
16
|
:accept => :json,
|
18
|
-
:no_auth => !
|
17
|
+
:no_auth => !client.api_always_auth
|
19
18
|
})
|
20
19
|
debug "Server supports API versions #{@server_api_versions.join(', ')}"
|
21
20
|
|
@@ -29,7 +28,7 @@ module RHC
|
|
29
28
|
:method => :get,
|
30
29
|
:accept => :json,
|
31
30
|
:api_version => api_version_negotiated,
|
32
|
-
:no_auth => !
|
31
|
+
:no_auth => !client.api_always_auth
|
33
32
|
})
|
34
33
|
end
|
35
34
|
else
|
data/lib/rhc/rest/client.rb
CHANGED
@@ -378,6 +378,7 @@ module RHC
|
|
378
378
|
@debug ||= false
|
379
379
|
|
380
380
|
@auth = options.delete(:auth)
|
381
|
+
@api_always_auth = options.delete(:api_always_auth)
|
381
382
|
|
382
383
|
self.headers.merge!(options.delete(:headers)) if options[:headers]
|
383
384
|
self.options.merge!(options)
|
@@ -389,6 +390,10 @@ module RHC
|
|
389
390
|
@end_point
|
390
391
|
end
|
391
392
|
|
393
|
+
def api_always_auth
|
394
|
+
@api_always_auth
|
395
|
+
end
|
396
|
+
|
392
397
|
def api
|
393
398
|
@api ||= RHC::Rest::Api.new(self, @preferred_api_versions).tap do |api|
|
394
399
|
self.current_api_version = api.api_version_negotiated
|
data/lib/rhc/tar_gz.rb
CHANGED
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: 135
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 38
|
9
|
+
- 4
|
10
|
+
version: 1.38.4
|
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: 2015-
|
18
|
+
date: 2015-10-23 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: net-ssh
|
@@ -23,22 +23,14 @@ dependencies:
|
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 25
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 0
|
32
|
-
- 11
|
33
|
-
version: 2.0.11
|
34
|
-
- - <
|
26
|
+
- - <=
|
35
27
|
- !ruby/object:Gem::Version
|
36
|
-
hash:
|
28
|
+
hash: 47
|
37
29
|
segments:
|
38
30
|
- 2
|
39
31
|
- 9
|
40
|
-
-
|
41
|
-
version: 2.9.
|
32
|
+
- 2
|
33
|
+
version: 2.9.2
|
42
34
|
type: :runtime
|
43
35
|
version_requirements: *id001
|
44
36
|
- !ruby/object:Gem::Dependency
|