rhc 0.73.14 → 0.74.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -19,17 +19,19 @@ spec = Gem::Specification.new do |s|
19
19
  s.files = FileList['lib/**/*.rb', 'bin/*', 'conf/*'].to_a
20
20
  s.files += %w(LICENSE README Rakefile)
21
21
  s.executables = ['rhc-create-app', 'rhc-create-domain', 'rhc-ctl-app', 'rhc-snapshot', 'rhc-user-info', 'rhc-tail-files']
22
+ begin
22
23
  # Use Ruby version to target F13, RHEL5, Windows and OSX (assume no Xcode)
23
- if RUBY_VERSION == "1.8.6" or RUBY_PLATFORM =~ /mswin/ or RUBY_PLATFORM =~ /darwin/
24
+ if ENV['JSON_PURE'] or (RUBY_VERSION == "1.8.6" or RUBY_PLATFORM =~ /mswin/ or RUBY_PLATFORM =~ /darwin/)
24
25
  s.add_dependency('json_pure')
25
26
  else
26
27
  s.add_dependency('json')
27
28
  end
29
+ end
28
30
  s.add_dependency('parseconfig')
29
31
  end
30
32
 
31
33
  # Define a :package task that bundles the gem
32
- Gem::PackageTask.new(spec) do |pkg|
34
+ Gem::PackageTask.new(spec) do |pkg, args|
33
35
  pkg.need_tar = false
34
36
  end
35
37
 
@@ -50,10 +50,10 @@ begin
50
50
  ["--debug", "-d", GetoptLong::NO_ARGUMENT],
51
51
  ["--help", "-h", GetoptLong::NO_ARGUMENT],
52
52
  ["--nogit", "-n", GetoptLong::NO_ARGUMENT],
53
- ["--rhlogin", "-l", GetoptLong::OPTIONAL_ARGUMENT],
54
- ["--password", "-p", GetoptLong::OPTIONAL_ARGUMENT],
53
+ ["--rhlogin", "-l", GetoptLong::REQUIRED_ARGUMENT],
54
+ ["--password", "-p", GetoptLong::REQUIRED_ARGUMENT],
55
55
  ["--app", "-a", GetoptLong::REQUIRED_ARGUMENT],
56
- ["--repo", "-r", GetoptLong::OPTIONAL_ARGUMENT],
56
+ ["--repo", "-r", GetoptLong::REQUIRED_ARGUMENT],
57
57
  ["--type", "-t", GetoptLong::REQUIRED_ARGUMENT]
58
58
  )
59
59
  opt = {}
@@ -51,7 +51,7 @@ begin
51
51
  ["--debug", "-d", GetoptLong::NO_ARGUMENT],
52
52
  ["--help", "-h", GetoptLong::NO_ARGUMENT],
53
53
  ["--rhlogin", "-l", GetoptLong::REQUIRED_ARGUMENT],
54
- ["--password", "-p", GetoptLong::OPTIONAL_ARGUMENT],
54
+ ["--password", "-p", GetoptLong::REQUIRED_ARGUMENT],
55
55
  ["--namespace", "-n", GetoptLong::REQUIRED_ARGUMENT],
56
56
  ["--alter", "-a", GetoptLong::NO_ARGUMENT]
57
57
  )
@@ -63,9 +63,9 @@ begin
63
63
  ["--help", "-h", GetoptLong::NO_ARGUMENT],
64
64
  ["--bypass", "-b", GetoptLong::NO_ARGUMENT],
65
65
  ["--embedded-list", "-L", GetoptLong::NO_ARGUMENT],
66
- ["--rhlogin", "-l", GetoptLong::OPTIONAL_ARGUMENT],
67
- ["--embed", "-e", GetoptLong::OPTIONAL_ARGUMENT],
68
- ["--password", "-p", GetoptLong::OPTIONAL_ARGUMENT],
66
+ ["--rhlogin", "-l", GetoptLong::REQUIRED_ARGUMENT],
67
+ ["--embed", "-e", GetoptLong::REQUIRED_ARGUMENT],
68
+ ["--password", "-p", GetoptLong::REQUIRED_ARGUMENT],
69
69
  ["--app", "-a", GetoptLong::REQUIRED_ARGUMENT],
70
70
  ["--command", "-c", GetoptLong::REQUIRED_ARGUMENT]
71
71
  )
@@ -49,9 +49,9 @@ begin
49
49
  ["--debug", "-d", GetoptLong::NO_ARGUMENT],
50
50
  ["--help", "-h", GetoptLong::NO_ARGUMENT],
51
51
  ["--app", "-a", GetoptLong::REQUIRED_ARGUMENT],
52
- ["--save", "-s", GetoptLong::OPTIONAL_ARGUMENT],
52
+ ["--save", "-s", GetoptLong::REQUIRED_ARGUMENT],
53
53
  ["--rhlogin", "-l", GetoptLong::REQUIRED_ARGUMENT],
54
- ["--password", "-p", GetoptLong::OPTIONAL_ARGUMENT]
54
+ ["--password", "-p", GetoptLong::REQUIRED_ARGUMENT]
55
55
  )
56
56
  opt = {}
57
57
  opts.each do |o, a|
@@ -22,6 +22,7 @@
22
22
  # SOFTWARE.
23
23
 
24
24
  require 'rhc-common'
25
+ require 'base64'
25
26
 
26
27
  #
27
28
  # print help
@@ -36,6 +37,7 @@ Tail the logs of an application
36
37
  -l|--rhlogin rhlogin Red Hat login (RHN or OpenShift login with OpenShift Express access) (#{rhlogin})
37
38
  -a|--app Target application (required)
38
39
  -f|--files File glob relative to app (default <application_name>/logs/*) (optional)
40
+ -o|--opts Options to pass to the server-side (linux based) tail command (-f is implicit. See the linux tail man page full list of options.) (Ex: --opts '-n 100')
39
41
  -p|--password password RHLogin password (optional, will prompt)
40
42
  -d|--debug Print Debug info
41
43
  -h|--help Show Usage info
@@ -49,9 +51,10 @@ begin
49
51
  ["--debug", "-d", GetoptLong::NO_ARGUMENT],
50
52
  ["--help", "-h", GetoptLong::NO_ARGUMENT],
51
53
  ["--app", "-a", GetoptLong::REQUIRED_ARGUMENT],
52
- ["--files", "-f", GetoptLong::OPTIONAL_ARGUMENT],
54
+ ["--opts", "-o", GetoptLong::REQUIRED_ARGUMENT],
55
+ ["--files", "-f", GetoptLong::REQUIRED_ARGUMENT],
53
56
  ["--rhlogin", "-l", GetoptLong::REQUIRED_ARGUMENT],
54
- ["--password", "-p", GetoptLong::OPTIONAL_ARGUMENT]
57
+ ["--password", "-p", GetoptLong::REQUIRED_ARGUMENT]
55
58
  )
56
59
  opt = {}
57
60
  opts.each do |o, a|
@@ -69,15 +72,15 @@ debug = get_var('debug') == 'false' ? nil : get_var('debug')
69
72
  libra_kfile = "#{ENV['HOME']}/.ssh/libra_id_rsa"
70
73
  libra_kpfile = "#{ENV['HOME']}/.ssh/libra_id_rsa.pub"
71
74
 
72
- if opt["help"] || !opt['app']
75
+ if opt['help'] || !opt['app']
73
76
  p_usage
74
77
  end
75
78
 
76
- if opt["debug"]
79
+ if opt['debug']
77
80
  debug = true
78
81
  end
79
82
 
80
- opt["rhlogin"] = get_var('default_rhlogin') unless opt["rhlogin"]
83
+ opt['rhlogin'] = get_var('default_rhlogin') unless opt['rhlogin']
81
84
 
82
85
  if !RHC::check_rhlogin(opt['rhlogin'])
83
86
  p_usage
@@ -105,7 +108,7 @@ file_glob = "#{opt['files']}"
105
108
  app_uuid = user_info['app_info'][app]['uuid']
106
109
  namespace = user_info['user_info']['namespace']
107
110
  rhc_domain = user_info['user_info']['rhc_domain']
108
- ssh_cmd = "ssh #{app_uuid}@#{app}-#{namespace}.#{rhc_domain} 'tail #{file_glob}'"
111
+ ssh_cmd = "ssh #{app_uuid}@#{app}-#{namespace}.#{rhc_domain} 'tail#{opt['opts'] ? ' --opts ' + Base64::encode64(opt['opts']).chomp : ''} #{file_glob}'"
109
112
 
110
113
  puts "Attempting to tail files: #{file_glob}"
111
114
  puts "Use ctl + c to stop"
@@ -51,7 +51,7 @@ begin
51
51
  ["--apps", "-a", GetoptLong::NO_ARGUMENT],
52
52
  ["--info", "-i", GetoptLong::NO_ARGUMENT],
53
53
  ["--rhlogin", "-l", GetoptLong::REQUIRED_ARGUMENT],
54
- ["--password", "-p", GetoptLong::OPTIONAL_ARGUMENT]
54
+ ["--password", "-p", GetoptLong::REQUIRED_ARGUMENT]
55
55
  )
56
56
  opt = {}
57
57
  opts.each do |o, a|
@@ -114,7 +114,7 @@ if opt['apps']
114
114
  puts " Public URL: http://#{key}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']}/"
115
115
  puts ""
116
116
  puts " Embedded: "
117
- if val['embedded']
117
+ if val['embedded'] && !val['embedded'].empty?
118
118
  val['embedded'].each do |embed_key, embed_val|
119
119
  puts " #{embed_key} - #{embed_val['info']}"
120
120
  end
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: 295
4
+ hash: 317
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 73
9
- - 14
10
- version: 0.73.14
8
+ - 74
9
+ - 5
10
+ version: 0.74.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-07-11 00:00:00 -05:00
18
+ date: 2011-07-21 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -61,12 +61,12 @@ extra_rdoc_files: []
61
61
 
62
62
  files:
63
63
  - lib/rhc-common.rb
64
+ - bin/rhc-ctl-app
65
+ - bin/rhc-snapshot
64
66
  - bin/rhc-create-domain
67
+ - bin/rhc-user-info
65
68
  - bin/rhc-tail-files
66
69
  - bin/rhc-create-app
67
- - bin/rhc-ctl-app
68
- - bin/rhc-user-info
69
- - bin/rhc-snapshot
70
70
  - conf/express.conf
71
71
  - LICENSE
72
72
  - README