rhc 0.96.9 → 0.97.17
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.
- data/README.md +1 -0
- data/bin/rhc +6 -18
- data/bin/rhc-app +3 -3
- data/bin/rhc-chk +2 -2
- data/bin/rhc-create-app +2 -2
- data/bin/rhc-create-domain +5 -2
- data/bin/rhc-ctl-app +2 -2
- data/bin/rhc-ctl-domain +5 -2
- data/bin/rhc-domain +6 -3
- data/bin/rhc-domain-info +6 -3
- data/bin/rhc-port-forward +9 -2
- data/bin/rhc-snapshot +2 -2
- data/bin/rhc-sshkey +2 -2
- data/bin/rhc-tail-files +2 -2
- data/features/lib/rhc_helper/app.rb +1 -1
- data/features/lib/rhc_helper/commandify.rb +32 -3
- data/features/lib/rhc_helper/domain.rb +46 -20
- data/features/step_definitions/cartridge_steps.rb +3 -3
- data/features/step_definitions/client_steps.rb +3 -1
- data/features/step_definitions/domain_steps.rb +45 -0
- data/features/verify.feature +36 -0
- data/lib/rhc-common.rb +6 -8
- data/lib/rhc-rest.rb +11 -2
- data/lib/rhc-rest/application.rb +20 -8
- data/lib/rhc-rest/cartridge.rb +18 -6
- data/lib/rhc-rest/client.rb +13 -37
- data/lib/rhc-rest/domain.rb +12 -4
- data/lib/rhc-rest/exceptions/exceptions.rb +1 -1
- data/lib/rhc-rest/key.rb +2 -2
- data/lib/rhc-rest/user.rb +2 -2
- data/lib/rhc/cli.rb +2 -3
- data/lib/rhc/commands.rb +154 -4
- data/lib/rhc/commands/base.rb +49 -12
- data/lib/rhc/commands/domain.rb +142 -0
- data/lib/rhc/commands/server.rb +1 -0
- data/lib/rhc/commands/setup.rb +3 -10
- data/lib/rhc/config.rb +20 -18
- data/lib/rhc/exceptions.rb +20 -0
- data/lib/rhc/help_formatter.rb +3 -22
- data/lib/rhc/helpers.rb +36 -5
- data/lib/rhc/json.rb +44 -44
- data/lib/rhc/targz.rb +3 -3
- data/lib/rhc/usage_templates/command_help.erb +26 -0
- data/lib/rhc/usage_templates/help.erb +27 -0
- data/lib/rhc/vendor/zliby.rb +563 -563
- data/lib/rhc/version.rb +2 -2
- data/lib/rhc/wizard.rb +10 -5
- data/spec/coverage_helper.rb +0 -1
- data/spec/rest_spec_helper.rb +95 -0
- data/spec/rhc/cli_spec.rb +7 -2
- data/spec/rhc/command_spec.rb +59 -13
- data/spec/rhc/commands/domain_spec.rb +225 -0
- data/spec/rhc/config_spec.rb +4 -4
- data/spec/rhc/helpers_spec.rb +27 -1
- data/spec/rhc/rest_application_spec.rb +6 -0
- data/spec/rhc/rest_client_spec.rb +32 -32
- data/spec/rhc/rest_spec.rb +2 -2
- data/spec/rhc/wizard_spec.rb +11 -4
- data/spec/spec_helper.rb +9 -9
- metadata +314 -312
data/README.md
CHANGED
@@ -80,6 +80,7 @@ first). See [README.md](https://github.com/openshift/rhc/blob/master/features/R
|
|
80
80
|
have full line coverage. Some old code is currently excluded until it
|
81
81
|
can be refactored. Run <code>bundle exec rake spec</code> on Ruby 1.9+
|
82
82
|
to see your code coverage level.
|
83
|
+
4. When writting a new Command please follow [ADDING_COMMANDS.md](https://github.com/openshift/rhc/blob/master/lib/rhc/commands/ADDING_COMMANDS.md)
|
83
84
|
|
84
85
|
Once you've made your changes:
|
85
86
|
|
data/bin/rhc
CHANGED
@@ -44,10 +44,6 @@ end
|
|
44
44
|
|
45
45
|
begin
|
46
46
|
case ARGV[0]
|
47
|
-
when "domain"
|
48
|
-
run_setup_wizard_if_needed
|
49
|
-
system("rhc-domain #{get_args} 2>&1")
|
50
|
-
retcode = $?.exitstatus
|
51
47
|
when "app"
|
52
48
|
run_setup_wizard_if_needed
|
53
49
|
system("rhc-app #{get_args} 2>&1")
|
@@ -60,21 +56,13 @@ begin
|
|
60
56
|
run_setup_wizard_if_needed
|
61
57
|
system("rhc-port-forward #{get_args} 2>&1")
|
62
58
|
retcode = $?.exitstatus
|
63
|
-
when "-h", "--help", "help", nil
|
64
|
-
p_usage 0
|
65
59
|
else
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
rescue SystemExit => e
|
73
|
-
retcode = e.status
|
74
|
-
end
|
75
|
-
else
|
76
|
-
puts "Invalid rhc command: #{ARGV[0]}"
|
77
|
-
p_usage
|
60
|
+
begin
|
61
|
+
require 'rhc/cli'
|
62
|
+
RHC::CLI.start(ARGV)
|
63
|
+
retcode = 0
|
64
|
+
rescue SystemExit => e
|
65
|
+
retcode = e.status
|
78
66
|
end
|
79
67
|
end
|
80
68
|
|
data/bin/rhc-app
CHANGED
@@ -35,7 +35,7 @@ List of commands
|
|
35
35
|
threaddump Trigger a thread dump for jbossas, jbosseap, and ruby applications
|
36
36
|
tail Tail the logs of an application
|
37
37
|
snapshot [save|restore] Saves/Restores an application snapshot to/from a tarball at the location specified using --filepath (default: ./$APPNAME.tar.gz)
|
38
|
-
cartridge <action> Manage a cartridge
|
38
|
+
cartridge <action> Manage a cartridge running in this application
|
39
39
|
|
40
40
|
List of cartridge actions
|
41
41
|
list List of supported embedded cartridges
|
@@ -48,8 +48,8 @@ List of cartridge actions
|
|
48
48
|
reload Reloads cartridge configuration
|
49
49
|
|
50
50
|
List of arguments
|
51
|
-
-l|--rhlogin rhlogin
|
52
|
-
-p|--password password
|
51
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
52
|
+
-p|--password password Password (optional, will prompt)
|
53
53
|
-a|--app application Application name (alphanumeric - max #{RHC::APP_NAME_MAX_LENGTH} chars) (required)
|
54
54
|
-t|--type type Type of app to create (#{type_keys}) (required for creating an application)
|
55
55
|
-c|--cartridge cartridge The embedded cartrige to manage (required for the cartridge command)
|
data/bin/rhc-chk
CHANGED
@@ -29,8 +29,8 @@ Usage: rhc domain status
|
|
29
29
|
Run a simple check on local configs and credentials to confirm tools are
|
30
30
|
properly setup. Often run to troubleshoot connection issues.
|
31
31
|
|
32
|
-
-l|--rhlogin rhlogin
|
33
|
-
-p|--password password
|
32
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
33
|
+
-p|--password password Password (optional, will prompt)
|
34
34
|
-d|--debug Print Debug info
|
35
35
|
-h|--help Show Usage info
|
36
36
|
--config path Path of alternate config file
|
data/bin/rhc-create-app
CHANGED
@@ -17,8 +17,8 @@ Create an OpenShift app.
|
|
17
17
|
-t|--type type Type of app to create (#{type_keys}) (required)
|
18
18
|
-g|--gear-size size The size of the gear for this app ([small|medium], defaults to small)
|
19
19
|
-s|--scaling Enable scaling for this app
|
20
|
-
-l|--rhlogin rhlogin
|
21
|
-
-p|--password password
|
20
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
21
|
+
-p|--password password Password (optional, will prompt)
|
22
22
|
-r|--repo path Git Repo path (defaults to ./$app_name)
|
23
23
|
-n|--nogit Only create remote space, don't pull it locally
|
24
24
|
-d|--debug Print Debug info
|
data/bin/rhc-create-domain
CHANGED
@@ -4,6 +4,9 @@ require 'rhc/coverage_helper'
|
|
4
4
|
|
5
5
|
require 'rhc-common'
|
6
6
|
|
7
|
+
puts "Warning: This command is deprecated and will be removed in the future. Please use 'rhc domain (create|update)' instead."
|
8
|
+
puts""
|
9
|
+
|
7
10
|
#
|
8
11
|
# print help
|
9
12
|
#
|
@@ -18,8 +21,8 @@ Bind a registered rhcloud user to a domain in rhcloud.
|
|
18
21
|
<id_rsa>.pub keys, then re-run with --alter
|
19
22
|
|
20
23
|
-n|--namespace namespace Namespace for your application(s) (alphanumeric - max #{RHC::DEFAULT_MAX_LENGTH} chars) (required)
|
21
|
-
-l|--rhlogin rhlogin
|
22
|
-
-p|--password password
|
24
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
25
|
+
-p|--password password Password (optional, will prompt)
|
23
26
|
-a|--alter Alter namespace (will change urls) and/or ssh key
|
24
27
|
-d|--debug Print Debug info
|
25
28
|
-h|--help Show Usage info
|
data/bin/rhc-ctl-app
CHANGED
@@ -14,8 +14,8 @@ Usage: #{$0}
|
|
14
14
|
Control an OpenShift express app
|
15
15
|
|
16
16
|
-a|--app application Application name (alphanumeric) (required)
|
17
|
-
-l|--rhlogin rhlogin
|
18
|
-
-p|--password password
|
17
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
18
|
+
-p|--password password Password (optional, will prompt)
|
19
19
|
-c|--command command (start|stop|force-stop|restart|reload|status|destroy|tidy|add-alias|remove-alias|threaddump)
|
20
20
|
-L|--embedded-list List supported embedded cartridges
|
21
21
|
-e|--embed (add|remove|stop|start|restart|status|reload)-$cartridge eg: add-mysql-5.1
|
data/bin/rhc-ctl-domain
CHANGED
@@ -4,6 +4,9 @@ require 'rhc/coverage_helper'
|
|
4
4
|
|
5
5
|
require 'rhc-common'
|
6
6
|
|
7
|
+
puts "Warning: This command is deprecated and will be removed in the future. Please use 'rhc sshkey' instead."
|
8
|
+
puts""
|
9
|
+
|
7
10
|
#
|
8
11
|
# print help
|
9
12
|
#
|
@@ -16,8 +19,8 @@ Manage multiple keys for the registered rhcloud user.
|
|
16
19
|
|
17
20
|
rhc-ctl-domain [-l rhlogin] [-p password] [-d] [-h] [-n namespace] (-a key-name [-k ssh-pubkey] | -u key-name [-k ssh-pubkey] | -r key-name | --destroy)
|
18
21
|
|
19
|
-
-l|--rhlogin rhlogin
|
20
|
-
-p|--password password
|
22
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
23
|
+
-p|--password password Password (optional, will prompt)
|
21
24
|
-n|--namespace namespace Namespace for your application(s) (alphanumeric - max #{RHC::DEFAULT_MAX_LENGTH} chars) (required for destroying domain)
|
22
25
|
-a|--add-ssh-key key-name Add SSH key to the user account (key-name is the user-specified identifier for the key)
|
23
26
|
-r|--remove-ssh-key key-name Remove SSH key from the user account
|
data/bin/rhc-domain
CHANGED
@@ -4,6 +4,9 @@ require 'rhc/coverage_helper'
|
|
4
4
|
|
5
5
|
require 'rhc-common'
|
6
6
|
|
7
|
+
puts "Warning: This command is deprecated and will be removed in the future. Please use 'rhc domain' instead."
|
8
|
+
puts""
|
9
|
+
|
7
10
|
#
|
8
11
|
# print help
|
9
12
|
#
|
@@ -22,8 +25,8 @@ List of commands
|
|
22
25
|
destroy Destroys the domain and any added ssh keys
|
23
26
|
|
24
27
|
List of arguments
|
25
|
-
-l|--rhlogin rhlogin
|
26
|
-
-p|--password password
|
28
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
29
|
+
-p|--password password Password (optional, will prompt)
|
27
30
|
-n|--namespace namespace Namespace for your application(s) (alphanumeric - max #{RHC::DEFAULT_MAX_LENGTH} chars) (required for creating or destroying domain)
|
28
31
|
-d|--debug Print Debug info
|
29
32
|
-h|--help Show Usage info
|
@@ -225,7 +228,7 @@ def show_domain_info()
|
|
225
228
|
end
|
226
229
|
|
227
230
|
#puts " UUID: #{user_info['user_info']['uuid']}"
|
228
|
-
puts "
|
231
|
+
puts " OpenShift login: #{user_info['user_info']['rhlogin']}"
|
229
232
|
|
230
233
|
puts "\n\n"
|
231
234
|
|
data/bin/rhc-domain-info
CHANGED
@@ -4,6 +4,9 @@ require 'rhc/coverage_helper'
|
|
4
4
|
|
5
5
|
require 'rhc-common'
|
6
6
|
|
7
|
+
puts "Warning: This command is deprecated and will be removed in the future. Please use 'rhc domain show' instead."
|
8
|
+
puts""
|
9
|
+
|
7
10
|
#
|
8
11
|
# print help
|
9
12
|
#
|
@@ -14,8 +17,8 @@ def p_usage(error_code = 255)
|
|
14
17
|
Usage: #{$0}
|
15
18
|
Display information about a user
|
16
19
|
|
17
|
-
-l|--rhlogin rhlogin
|
18
|
-
-p|--password password
|
20
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
21
|
+
-p|--password password Password (optional, will prompt)
|
19
22
|
-a|--apps List applications for rhlogin
|
20
23
|
-i|--info Show user info
|
21
24
|
-d|--debug Print Debug info
|
@@ -95,7 +98,7 @@ if opt['info']
|
|
95
98
|
domains.each_index { |i| puts "Namespace(#{i}): #{domains[i]['namespace']}" }
|
96
99
|
end
|
97
100
|
#puts " UUID: #{user_info['user_info']['uuid']}"
|
98
|
-
puts "
|
101
|
+
puts " OpenShift login: #{user_info['user_info']['rhlogin']}"
|
99
102
|
puts "Primary SSH key: #{user_info['user_info']['ssh_key']}"
|
100
103
|
puts "Primary SSH key type: #{user_info['user_info']['ssh_type']}" unless user_info['user_info']['ssh_type'].to_s.strip.length == 0
|
101
104
|
|
data/bin/rhc-port-forward
CHANGED
@@ -14,9 +14,9 @@ def p_usage(exit_code = 255)
|
|
14
14
|
Usage: rhc port-forward
|
15
15
|
Forward remote ports to the workstation
|
16
16
|
|
17
|
-
-l|--rhlogin rhlogin
|
17
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
18
18
|
-a|--app Target application (required)
|
19
|
-
-p|--password password
|
19
|
+
-p|--password password Password (optional, will prompt)
|
20
20
|
-d|--debug Print Debug info
|
21
21
|
-h|--help Show Usage info
|
22
22
|
--config path Path of alternate config file
|
@@ -86,6 +86,13 @@ unless user_info['app_info'][app_name]
|
|
86
86
|
exit 101
|
87
87
|
end
|
88
88
|
|
89
|
+
if (user_info['app_info'][app_name].has_key?('embedded') && user_info['app_info'][app_name]['embedded'].keys.any?{ |k| k =~ /\Ahaproxy/ })
|
90
|
+
puts
|
91
|
+
puts "This utility does not currently support scaled applications.\n"
|
92
|
+
puts "You will need to set up port forwarding manually.\n"
|
93
|
+
puts
|
94
|
+
exit 101
|
95
|
+
end
|
89
96
|
|
90
97
|
# mock for windows
|
91
98
|
if defined?(UNIXServer) != 'constant' or UNIXServer.class != Class
|
data/bin/rhc-snapshot
CHANGED
@@ -14,11 +14,11 @@ def p_usage(exit_code = 255)
|
|
14
14
|
Usage: #{$0}
|
15
15
|
Pull down application snapshot for a user
|
16
16
|
|
17
|
-
-l|--rhlogin rhlogin
|
17
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
18
18
|
-a|--app Target application to snapshot (required)
|
19
19
|
-r|--restore Local path of the tarball to restore (restores git and application data folders found in archive)
|
20
20
|
-s|--save Local path to save tarball (default: ./$APPNAME.tar.gz)
|
21
|
-
-p|--password password
|
21
|
+
-p|--password password Password (optional, will prompt)
|
22
22
|
-d|--debug Print Debug info
|
23
23
|
-h|--help Show Usage info
|
24
24
|
--config path Path of alternate config file
|
data/bin/rhc-sshkey
CHANGED
@@ -21,8 +21,8 @@ List of commands
|
|
21
21
|
remove Remove SSH key from the user account
|
22
22
|
|
23
23
|
List of arguments
|
24
|
-
-l|--rhlogin rhlogin
|
25
|
-
-p|--password password
|
24
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
25
|
+
-p|--password password Password (optional, will prompt)
|
26
26
|
-i|--identifier key-name User-specified identifier for the key
|
27
27
|
-k|--ssh key-filepath SSH public key filepath
|
28
28
|
-d|--debug Print Debug info
|
data/bin/rhc-tail-files
CHANGED
@@ -15,11 +15,11 @@ def p_usage(exit_code = 255)
|
|
15
15
|
Usage: #{$0}
|
16
16
|
Tail the logs of an application
|
17
17
|
|
18
|
-
-l|--rhlogin rhlogin
|
18
|
+
-l|--rhlogin rhlogin OpenShift login (#{rhlogin})
|
19
19
|
-a|--app Target application (required)
|
20
20
|
-f|--files File glob relative to app (default <application_name>/logs/*) (optional)
|
21
21
|
-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')
|
22
|
-
-p|--password password
|
22
|
+
-p|--password password Password (optional, will prompt)
|
23
23
|
-d|--debug Print Debug info
|
24
24
|
-h|--help Show Usage info
|
25
25
|
--config path Path of alternate config file
|
@@ -16,11 +16,15 @@ module RHCHelper
|
|
16
16
|
# Add arguments to the command
|
17
17
|
cmd << get_args(cmd, args[0])
|
18
18
|
|
19
|
+
exitcode = nil
|
19
20
|
# Run the command, timing it
|
20
21
|
time = Benchmark.realtime do
|
21
|
-
run(cmd, args[0], &cmd_callback)
|
22
|
+
exitcode = run(cmd, args[0], &cmd_callback)
|
22
23
|
end
|
23
24
|
|
25
|
+
# if there is a callback let it take care of validating the results
|
26
|
+
exitcode.should == 0 unless cmd_callback
|
27
|
+
|
24
28
|
# Log the benchmarking info
|
25
29
|
perf_logger.info "#{time} #{sym.to_s.upcase} #{$namespace} #{$login}"
|
26
30
|
else
|
@@ -58,8 +62,12 @@ module RHCHelper
|
|
58
62
|
|
59
63
|
# Command specific arguments
|
60
64
|
case cmd
|
61
|
-
when /domain/
|
65
|
+
when /domain show/
|
66
|
+
# domain show doesn't take arguments
|
67
|
+
when /domain /
|
62
68
|
raise "No namespace set" unless $namespace
|
69
|
+
# use legacy switch for specifying namespace to verify older interface
|
70
|
+
# should switch to using argument once all commands are moved over
|
63
71
|
args << "-n #{$namespace} "
|
64
72
|
when /destroy/
|
65
73
|
args << "-b "
|
@@ -87,7 +95,7 @@ module RHCHelper
|
|
87
95
|
def get_cmd_callback(cmd, cartridge=nil)
|
88
96
|
# Break the command up on spaces
|
89
97
|
cmd_parts = cmd.split
|
90
|
-
|
98
|
+
|
91
99
|
# Drop the 'rhc' portion from the array
|
92
100
|
cmd_parts.shift
|
93
101
|
|
@@ -151,4 +159,25 @@ module RHCHelper
|
|
151
159
|
@embed.delete(cartridge)
|
152
160
|
persist
|
153
161
|
end
|
162
|
+
|
163
|
+
def domain_callback(exitcode, stdout, stderr, arg)
|
164
|
+
@domain_output = stdout
|
165
|
+
end
|
166
|
+
|
167
|
+
def domain_show_callback(exitcode, stdout, stderr, arg)
|
168
|
+
@domain_show_output = stdout
|
169
|
+
end
|
170
|
+
|
171
|
+
def domain_create_callback(exitcode, stdout, stderr, arg)
|
172
|
+
@exitcode = exitcode
|
173
|
+
end
|
174
|
+
|
175
|
+
def domain_update_callback(exitcode, stdout, stderr, arg)
|
176
|
+
@exitcode = exitcode
|
177
|
+
end
|
178
|
+
|
179
|
+
def domain_delete_callback(exitcode, stdout, stderr, arg)
|
180
|
+
@exitcode = exitcode
|
181
|
+
end
|
182
|
+
|
154
183
|
end
|
@@ -10,29 +10,55 @@ module RHCHelper
|
|
10
10
|
extend Commandify
|
11
11
|
include Dnsruby
|
12
12
|
|
13
|
+
class << self
|
14
|
+
attr_reader :domain_output, :domain_show_output, :exitcode
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.unique_namespace(prefix)
|
18
|
+
namepace = nil
|
19
|
+
begin
|
20
|
+
# Loop until we find a unique namespace
|
21
|
+
chars = ("1".."9").to_a
|
22
|
+
namespace = prefix + Array.new(8, '').collect{chars[rand(chars.size)]}.join
|
23
|
+
|
24
|
+
end while reserved?(namespace)
|
25
|
+
namespace
|
26
|
+
end
|
27
|
+
|
13
28
|
def self.create_if_needed(prefix="test")
|
14
29
|
unless $namespace
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
$namespace = unique_namespace(prefix)
|
31
|
+
# Create the domain
|
32
|
+
rhc_domain_create
|
33
|
+
|
34
|
+
# Write the new domain to a file in the temp directory
|
35
|
+
File.open(File.join(RHCHelper::TEMP_DIR, 'namespace'), 'w') do |f|
|
36
|
+
f.write($namespace)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.delete
|
42
|
+
rhc_domain_delete
|
43
|
+
$namespace = nil
|
44
|
+
# Write the new domain to a file in the temp directory
|
45
|
+
namespace_file = File.join(RHCHelper::TEMP_DIR, 'namespace')
|
46
|
+
File.delete(namespace_file) if File.exists?(namespace_file)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.update(prefix="update")
|
50
|
+
old_namespace = $namespace
|
51
|
+
$namespace = unique_namespace(prefix)
|
52
|
+
rhc_domain_update
|
53
|
+
|
54
|
+
namespace_file = File.join(RHCHelper::TEMP_DIR, 'namespace')
|
55
|
+
if @exitcode == 0
|
56
|
+
# Write the new domain to a file in the temp directory
|
57
|
+
File.open(namespace_file, 'w') do |f|
|
58
|
+
f.write($namespace)
|
35
59
|
end
|
60
|
+
else
|
61
|
+
$namespace = old_namespace
|
36
62
|
end
|
37
63
|
end
|
38
64
|
|
@@ -32,11 +32,11 @@ Then /^the (.+) cartridge should be stopped$/ do |name|
|
|
32
32
|
end
|
33
33
|
|
34
34
|
Then /^the (.+) cartridge should be removed$/ do |name|
|
35
|
-
# for
|
36
|
-
@app.cartridge(name).status.should match("
|
35
|
+
# look for response code 400
|
36
|
+
@app.cartridge(name).status.should match("Response code was 400")
|
37
37
|
end
|
38
38
|
|
39
39
|
|
40
40
|
Then /^adding the (.+) cartridge should fail$/ do |name|
|
41
|
-
@app.add_cartridge(name).should ==
|
41
|
+
@app.add_cartridge(name).should == 154
|
42
42
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rhc/wizard'
|
2
|
+
|
1
3
|
# Cross-platform way of finding an executable in the $PATH.
|
2
4
|
#
|
3
5
|
# which('ruby') #=> /usr/bin/ruby
|
@@ -27,6 +29,6 @@ When /^the setup wizard is run$/ do
|
|
27
29
|
end
|
28
30
|
|
29
31
|
Then /^the client tools should be setup$/ do
|
30
|
-
RHC::Config.
|
32
|
+
RHC::Wizard.new(RHC::Config).needs_configuration?.should be_false, "Wizard still thinks it needs to be run"
|
31
33
|
end
|
32
34
|
|