[DRE-commits] [rhc] 01/08: Imported Upstream version 1.38.4
Chow Loong Jin
hyperair at debian.org
Wed Nov 11 03:02:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
hyperair pushed a commit to branch master
in repository rhc.
commit 2ffd8b267382400343ed93fff463e9cc70996033
Author: Chow Loong Jin <hyperair at debian.org>
Date: Mon Nov 9 01:15:34 2015 +0800
Imported Upstream version 1.38.4
---
features/app_feature.rb | 12 ++++++++++++
lib/rhc/commands.rb | 2 +-
lib/rhc/commands/cartridge.rb | 2 +-
lib/rhc/core_ext.rb | 4 ++--
lib/rhc/exceptions.rb | 2 +-
lib/rhc/git_helpers.rb | 2 +-
lib/rhc/helpers.rb | 4 +++-
lib/rhc/output_helpers.rb | 4 ++--
lib/rhc/rest/api.rb | 5 ++---
lib/rhc/rest/client.rb | 5 +++++
lib/rhc/tar_gz.rb | 2 +-
metadata.yml | 26 +++++++++-----------------
12 files changed, 40 insertions(+), 30 deletions(-)
diff --git a/features/app_feature.rb b/features/app_feature.rb
index f126a2b..0274f93 100644
--- a/features/app_feature.rb
+++ b/features/app_feature.rb
@@ -11,6 +11,18 @@ describe "rhc app scenarios" do
let(:app){ @app }
it "should clone successfully" do
+ # The following works around an issue with strict host key checking.
+ # create-app --from-app uses SSH to copy the application. However,
+ # this test uses a new application, so without this workaround, create-app
+ # --from-app will be trying to log into the application for the first
+ # time, and so SSH will not recognize the host key and will prompt for
+ # confirmation, causing the test to hang and eventually time out. To work
+ # around the problem, we tell rhc to initiate an SSH connection using
+ # GIT_SSH (which disables strict host key checking), which will cause SSH
+ # to add the host to ~/.ssh/known_hosts, which will allow the subsequent
+ # create-app --from-app command to succeed.
+ rhc 'ssh', '--ssh', ENV['GIT_SSH'], app.name, '--', 'true'
+
app_name = "clone#{random}"
r = rhc 'create-app', app_name, '--from-app', app.name
r.stdout.should match /Domain:\s+#{app.domain}/
diff --git a/lib/rhc/commands.rb b/lib/rhc/commands.rb
index 140bdce..44cce29 100644
--- a/lib/rhc/commands.rb
+++ b/lib/rhc/commands.rb
@@ -6,7 +6,7 @@ require 'commander/command'
module Commander
class Command
attr_accessor :default_action, :root, :info
-
+
def default_action?
default_action.present?
end
diff --git a/lib/rhc/commands/cartridge.rb b/lib/rhc/commands/cartridge.rb
index b233e61..41c9cb4 100644
--- a/lib/rhc/commands/cartridge.rb
+++ b/lib/rhc/commands/cartridge.rb
@@ -147,7 +147,7 @@ module RHC::Commands
summary "Start a cartridge"
syntax "<cartridge> [--namespace NAME] [--app NAME]"
- argument :cart_type, "The name of the cartridge you are stopping", ["-c", "--cartridge cartridge"]
+ argument :cart_type, "The name of the cartridge you are starting", ["-c", "--cartridge cartridge"]
takes_application
alias_action :"app cartridge start", :root_command => true, :deprecated => true
def start(cartridge)
diff --git a/lib/rhc/core_ext.rb b/lib/rhc/core_ext.rb
index f37f22c..464ec6c 100644
--- a/lib/rhc/core_ext.rb
+++ b/lib/rhc/core_ext.rb
@@ -7,7 +7,7 @@ class Object
def present?
!blank?
end
-
+
def blank?
respond_to?(:empty?) ? empty? : !self
end
@@ -40,7 +40,7 @@ class Array
results
end
- end
+ end
end
class File
diff --git a/lib/rhc/exceptions.rb b/lib/rhc/exceptions.rb
index 57ae717..f01a07b 100644
--- a/lib/rhc/exceptions.rb
+++ b/lib/rhc/exceptions.rb
@@ -295,7 +295,7 @@ module RHC
super message
end
end
-
+
class RemoteFileOrPathNotFound < FileOrPathNotFound
def initialize(message="Remote File, file path, or directory could not be found")
super message
diff --git a/lib/rhc/git_helpers.rb b/lib/rhc/git_helpers.rb
index 7306403..53e9ddd 100644
--- a/lib/rhc/git_helpers.rb
+++ b/lib/rhc/git_helpers.rb
@@ -83,7 +83,7 @@ module RHC
def git_config_get(key)
return nil unless has_git?
-
+
config_get_cmd = "#{discover_git_executable} config --get #{key}"
value = %x[#{config_get_cmd}].strip
debug "Git config '#{config_get_cmd}' returned '#{value}'"
diff --git a/lib/rhc/helpers.rb b/lib/rhc/helpers.rb
index 4210d4f..e9c4b51 100644
--- a/lib/rhc/helpers.rb
+++ b/lib/rhc/helpers.rb
@@ -135,6 +135,7 @@ module RHC
global_option('--timeout SECONDS', Integer, 'The timeout for operations') do |value|
raise RHC::Exception, "Timeout must be a positive integer" unless value > 0
end
+ global_option '--always-auth', "Always use authentication when making OpenShift API requests.", :hide => true
global_option '--noprompt', "Suppress all interactive operations command", :hide => true do
$terminal.page_at = nil
end
@@ -200,7 +201,7 @@ module RHC
return nil if token_store_user_key.nil?
token_store.get(token_store_user_key, options.server)
end
-
+
def parse_headers(headers)
Hash[
Array(headers).map do |header|
@@ -217,6 +218,7 @@ module RHC
:headers => parse_headers(options.header),
:timeout => options.timeout,
:warn => BOUND_WARNING,
+ :api_always_auth => options.always_auth
}.merge!(ssl_options).merge!(opts))
end
diff --git a/lib/rhc/output_helpers.rb b/lib/rhc/output_helpers.rb
index fdda74d..3a22a4a 100644
--- a/lib/rhc/output_helpers.rb
+++ b/lib/rhc/output_helpers.rb
@@ -66,7 +66,7 @@ module RHC
end
end
end
-
+
def display_app_summary(applications)
section do
if !applications.nil? and !applications.empty?
@@ -79,7 +79,7 @@ module RHC
end
end
end
-
+
end
def display_app_configurations(rest_app)
diff --git a/lib/rhc/rest/api.rb b/lib/rhc/rest/api.rb
index c946f64..dbceffc 100644
--- a/lib/rhc/rest/api.rb
+++ b/lib/rhc/rest/api.rb
@@ -10,12 +10,11 @@ module RHC
@server_api_versions = []
debug "Client supports API versions #{preferred_api_versions.join(', ')}"
@client_api_versions = preferred_api_versions
- always_auth = RHC::Helpers.to_boolean(RHC::Config['always_auth'], false)
@server_api_versions, @current_api_version, links = api_info({
:url => client.url,
:method => :get,
:accept => :json,
- :no_auth => !always_auth,
+ :no_auth => !client.api_always_auth
})
debug "Server supports API versions #{@server_api_versions.join(', ')}"
@@ -29,7 +28,7 @@ module RHC
:method => :get,
:accept => :json,
:api_version => api_version_negotiated,
- :no_auth => !always_auth,
+ :no_auth => !client.api_always_auth
})
end
else
diff --git a/lib/rhc/rest/client.rb b/lib/rhc/rest/client.rb
index c906926..473937c 100644
--- a/lib/rhc/rest/client.rb
+++ b/lib/rhc/rest/client.rb
@@ -378,6 +378,7 @@ module RHC
@debug ||= false
@auth = options.delete(:auth)
+ @api_always_auth = options.delete(:api_always_auth)
self.headers.merge!(options.delete(:headers)) if options[:headers]
self.options.merge!(options)
@@ -389,6 +390,10 @@ module RHC
@end_point
end
+ def api_always_auth
+ @api_always_auth
+ end
+
def api
@api ||= RHC::Rest::Api.new(self, @preferred_api_versions).tap do |api|
self.current_api_version = api.api_version_negotiated
diff --git a/lib/rhc/tar_gz.rb b/lib/rhc/tar_gz.rb
index eab05ce..33af135 100644
--- a/lib/rhc/tar_gz.rb
+++ b/lib/rhc/tar_gz.rb
@@ -9,7 +9,7 @@ module RHC
module TarGz
def self.contains(filename, search, force_ruby=false)
-
+
return false if ! (File.file? filename and File.basename(filename).downcase =~ /.\.t(ar\.)?gz$/i)
regex = Regexp.new search
diff --git a/metadata.yml b/metadata.yml
index 042b37b..b8236fa 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,13 +1,13 @@
--- !ruby/object:Gem::Specification
name: rhc
version: !ruby/object:Gem::Version
- hash: 129
+ hash: 135
prerelease:
segments:
- 1
- - 37
- - 1
- version: 1.37.1
+ - 38
+ - 4
+ version: 1.38.4
platform: ruby
authors:
- Red Hat
@@ -15,7 +15,7 @@ autorequire:
bindir: bin
cert_chain: []
-date: 2015-08-26 00:00:00 Z
+date: 2015-10-23 00:00:00 Z
dependencies:
- !ruby/object:Gem::Dependency
name: net-ssh
@@ -23,22 +23,14 @@ dependencies:
requirement: &id001 !ruby/object:Gem::Requirement
none: false
requirements:
- - - ">="
- - !ruby/object:Gem::Version
- hash: 25
- segments:
- - 2
- - 0
- - 11
- version: 2.0.11
- - - <
+ - - <=
- !ruby/object:Gem::Version
- hash: 45
+ hash: 47
segments:
- 2
- 9
- - 3
- version: 2.9.3
+ - 2
+ version: 2.9.2
type: :runtime
version_requirements: *id001
- !ruby/object:Gem::Dependency
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/rhc.git
More information about the Pkg-ruby-extras-commits
mailing list