rhc 1.37.1 → 1.38.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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}/
@@ -6,7 +6,7 @@ require 'commander/command'
6
6
  module Commander
7
7
  class Command
8
8
  attr_accessor :default_action, :root, :info
9
-
9
+
10
10
  def default_action?
11
11
  default_action.present?
12
12
  end
@@ -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 stopping", ["-c", "--cartridge cartridge"]
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)
@@ -7,7 +7,7 @@ class Object
7
7
  def present?
8
8
  !blank?
9
9
  end
10
-
10
+
11
11
  def blank?
12
12
  respond_to?(:empty?) ? empty? : !self
13
13
  end
@@ -40,7 +40,7 @@ class Array
40
40
 
41
41
  results
42
42
  end
43
- end
43
+ end
44
44
  end
45
45
 
46
46
  class File
@@ -295,7 +295,7 @@ module RHC
295
295
  super message
296
296
  end
297
297
  end
298
-
298
+
299
299
  class RemoteFileOrPathNotFound < FileOrPathNotFound
300
300
  def initialize(message="Remote File, file path, or directory could not be found")
301
301
  super message
@@ -83,7 +83,7 @@ module RHC
83
83
 
84
84
  def git_config_get(key)
85
85
  return nil unless has_git?
86
-
86
+
87
87
  config_get_cmd = "#{discover_git_executable} config --get #{key}"
88
88
  value = %x[#{config_get_cmd}].strip
89
89
  debug "Git config '#{config_get_cmd}' returned '#{value}'"
@@ -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
 
@@ -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)
@@ -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 => !always_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 => !always_auth,
31
+ :no_auth => !client.api_always_auth
33
32
  })
34
33
  end
35
34
  else
@@ -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
@@ -9,7 +9,7 @@ module RHC
9
9
  module TarGz
10
10
 
11
11
  def self.contains(filename, search, force_ruby=false)
12
-
12
+
13
13
  return false if ! (File.file? filename and File.basename(filename).downcase =~ /.\.t(ar\.)?gz$/i)
14
14
 
15
15
  regex = Regexp.new search
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: 129
4
+ hash: 135
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 37
9
- - 1
10
- version: 1.37.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-08-26 00:00:00 Z
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: 45
28
+ hash: 47
37
29
  segments:
38
30
  - 2
39
31
  - 9
40
- - 3
41
- version: 2.9.3
32
+ - 2
33
+ version: 2.9.2
42
34
  type: :runtime
43
35
  version_requirements: *id001
44
36
  - !ruby/object:Gem::Dependency