rhc 0.97.17 → 0.98.16
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/bin/rhc +9 -9
- data/bin/rhc-port-forward +3 -0
- data/bin/rhc-sshkey +3 -0
- data/features/README.md +163 -35
- data/features/application.feature +24 -0
- data/features/cartridge.feature +24 -0
- data/features/client.feature +11 -0
- data/features/domain.feature +29 -0
- data/features/lib/rhc_helper.rb +14 -0
- data/features/lib/rhc_helper/app.rb +2 -8
- data/features/lib/rhc_helper/cartridge.rb +1 -7
- data/features/lib/rhc_helper/commandify.rb +37 -6
- data/features/lib/rhc_helper/domain.rb +5 -1
- data/features/lib/rhc_helper/httpify.rb +124 -60
- data/features/lib/rhc_helper/loggable.rb +0 -2
- data/features/lib/rhc_helper/persistable.rb +12 -2
- data/features/lib/rhc_helper/sshkey.rb +29 -0
- data/features/multiple_cartridge.feature +17 -0
- data/features/sshkey.feature +58 -0
- data/features/step_definitions/application_steps.rb +60 -52
- data/features/step_definitions/cartridge_steps.rb +22 -24
- data/features/step_definitions/client_steps.rb +9 -2
- data/features/step_definitions/domain_steps.rb +4 -0
- data/features/step_definitions/sshkey_steps.rb +56 -0
- data/features/support/assumptions.rb +37 -0
- data/features/support/before_hooks.rb +25 -0
- data/features/support/env.rb +84 -39
- data/features/support/key1 +27 -0
- data/features/support/key1.pub +1 -0
- data/features/support/key2 +27 -0
- data/features/support/key2.pub +1 -0
- data/features/support/key3.pub +1 -0
- data/features/support/ssh.sh +2 -0
- data/features/verify.feature +18 -159
- data/lib/rhc-common.rb +8 -21
- data/lib/rhc.rb +9 -5
- data/lib/rhc/autocomplete.rb +68 -0
- data/lib/rhc/autocomplete_templates/rhc.erb +33 -0
- data/lib/rhc/cli.rb +9 -6
- data/lib/rhc/command_runner.rb +108 -0
- data/lib/rhc/commands.rb +66 -132
- data/lib/rhc/commands/base.rb +95 -24
- data/lib/rhc/commands/domain.rb +33 -50
- data/lib/rhc/commands/port-forward.rb +81 -0
- data/lib/rhc/commands/setup.rb +1 -1
- data/lib/rhc/commands/sshkey.rb +95 -0
- data/lib/rhc/config.rb +108 -103
- data/lib/rhc/context_helper.rb +19 -0
- data/lib/rhc/coverage_helper.rb +1 -1
- data/lib/rhc/exceptions.rb +55 -4
- data/lib/rhc/help_formatter.rb +2 -3
- data/lib/rhc/helpers.rb +31 -23
- data/lib/{rhc-rest.rb → rhc/rest.rb} +95 -23
- data/lib/{rhc-rest → rhc/rest}/application.rb +1 -1
- data/lib/{rhc-rest → rhc/rest}/cartridge.rb +1 -1
- data/lib/{rhc-rest → rhc/rest}/client.rb +40 -9
- data/lib/{rhc-rest → rhc/rest}/domain.rb +1 -1
- data/lib/{rhc-rest → rhc/rest}/key.rb +11 -1
- data/lib/{rhc-rest → rhc/rest}/user.rb +1 -1
- data/lib/rhc/ssh_key_helpers.rb +10 -1
- data/lib/rhc/targz.rb +7 -8
- data/lib/rhc/usage_templates/command_help.erb +7 -6
- data/lib/rhc/usage_templates/help.erb +6 -9
- data/lib/rhc/usage_templates/missing_help.erb +1 -0
- data/lib/rhc/version.rb +2 -2
- data/lib/rhc/wizard.rb +4 -9
- data/spec/coverage_helper.rb +2 -2
- data/spec/rest_spec_helper.rb +66 -16
- data/spec/rhc/cli_spec.rb +16 -5
- data/spec/rhc/command_spec.rb +61 -6
- data/spec/rhc/commands/domain_spec.rb +50 -27
- data/spec/rhc/commands/port-forward_spec.rb +133 -0
- data/spec/rhc/commands/setup_spec.rb +2 -2
- data/spec/rhc/commands/sshkey_spec.rb +141 -0
- data/spec/rhc/common_spec.rb +1 -1
- data/spec/rhc/config_spec.rb +6 -4
- data/spec/rhc/helpers_spec.rb +0 -21
- data/spec/rhc/rest_application_spec.rb +7 -7
- data/spec/rhc/rest_client_spec.rb +87 -24
- data/spec/rhc/rest_spec.rb +36 -36
- data/spec/rhc/wizard_spec.rb +3 -3
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +3 -3
- metadata +61 -31
- data/lib/rhc-rest/exceptions/exceptions.rb +0 -75
- data/test/functional/application_test.rb +0 -71
- data/test/functional/domain_test.rb +0 -123
- data/test/functional/test_credentials.rb +0 -5
- data/test/sample-usage.rb +0 -122
- data/test/support/server.rb +0 -14
- data/test/support/testcase.rb +0 -3
- data/test/test_helper.rb +0 -4
- data/test/unit/command_test.rb +0 -19
data/bin/rhc
CHANGED
@@ -39,7 +39,14 @@ def get_args
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def run_setup_wizard_if_needed
|
42
|
-
|
42
|
+
if not (RHC::Config.has_local_config? or
|
43
|
+
RHC::Config.has_opts_config? or
|
44
|
+
ARGV.include?('--noprompt') or
|
45
|
+
ARGV.include?('--help') or
|
46
|
+
ARGV.include?('-h'))
|
47
|
+
RHC::Wizard.new(RHC::Config).run
|
48
|
+
end
|
49
|
+
ARGV.delete('--noprompt')
|
43
50
|
end
|
44
51
|
|
45
52
|
begin
|
@@ -48,17 +55,10 @@ begin
|
|
48
55
|
run_setup_wizard_if_needed
|
49
56
|
system("rhc-app #{get_args} 2>&1")
|
50
57
|
retcode = $?.exitstatus
|
51
|
-
when "sshkey"
|
52
|
-
run_setup_wizard_if_needed
|
53
|
-
system("rhc-sshkey #{get_args} 2>&1")
|
54
|
-
retcode = $?.exitstatus
|
55
|
-
when "port-forward"
|
56
|
-
run_setup_wizard_if_needed
|
57
|
-
system("rhc-port-forward #{get_args} 2>&1")
|
58
|
-
retcode = $?.exitstatus
|
59
58
|
else
|
60
59
|
begin
|
61
60
|
require 'rhc/cli'
|
61
|
+
RHC::CLI.set_terminal
|
62
62
|
RHC::CLI.start(ARGV)
|
63
63
|
retcode = 0
|
64
64
|
rescue SystemExit => e
|
data/bin/rhc-port-forward
CHANGED
data/bin/rhc-sshkey
CHANGED
data/features/README.md
CHANGED
@@ -3,68 +3,196 @@ Overview
|
|
3
3
|
|
4
4
|
These tests can be run against a production or OpenShift Origin instance for
|
5
5
|
verification of basic functionality. These tests should be operating system
|
6
|
-
independent and will shell out to execute the
|
7
|
-
user as closely as possible. These tests exercise both the
|
6
|
+
independent and will shell out to execute the `rhc *` commands to emulate a
|
7
|
+
user as closely as possible. These tests exercise both the command-line
|
8
8
|
client and the underlying infrastructure and serve as integration level
|
9
9
|
verification tests for the entire stack.
|
10
10
|
|
11
11
|
Usage
|
12
12
|
=============
|
13
13
|
|
14
|
-
Run from the base directory with
|
14
|
+
Run from the base directory with
|
15
15
|
|
16
|
-
|
16
|
+
```
|
17
|
+
<env variables> bundle exec rake features
|
18
|
+
```
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
+
At the very least, you will probably want to specify `RHC_SERVER` (or
|
21
|
+
the tests will run against the production OpenShift server by default).
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
+
You may also want to specify credentials to use a specific account on
|
24
|
+
the OpenShift server.
|
23
25
|
|
24
|
-
|
26
|
+
All of these environment variables are described in detail in [the
|
27
|
+
next section](#environment-variables).
|
25
28
|
|
26
|
-
|
29
|
+
If you are developing tests, or want to run specific tests, make sure to
|
30
|
+
check out the [development usage section](#development-usage).
|
27
31
|
|
28
|
-
|
29
|
-
|
32
|
+
Environment Variables
|
33
|
+
=====================
|
34
|
+
Much of the configuration for these tests is controlled through
|
35
|
+
environment variables.
|
36
|
+
They can be used with either the `rake` commands or when executing
|
37
|
+
`cucumber` directly.
|
38
|
+
|
39
|
+
http_proxy
|
40
|
+
----------
|
41
|
+
Since the `rhc` tools use a HTTP based REST API, if you need a proxy to
|
42
|
+
access the server you are testing against, you will need to specify a
|
43
|
+
proxy. For instance:
|
44
|
+
|
45
|
+
http_proxy='http://proxyserver:proxyport/'
|
46
|
+
|
47
|
+
GIT_SSH
|
48
|
+
-------
|
49
|
+
This is automatically set in `features/support/env.rb` but can be
|
50
|
+
overridden if desired.
|
51
|
+
|
52
|
+
This environment variable will be used by any `git` or `ssh` commands.
|
53
|
+
Currently, we are using it to bypass host key validation because the
|
54
|
+
user will be connecting to unknown hosts (the new OpenShift apps).
|
55
|
+
Without this variable, the tests will wait for approval before
|
56
|
+
connecting to the host.
|
57
|
+
|
58
|
+
RHC_DEV
|
59
|
+
-------
|
60
|
+
If set, this will use the `libra_server` specified in
|
61
|
+
`~/.openshift/express.conf` for `RHC_SERVER` (unless `RHC_SERVER` is
|
62
|
+
also specified).
|
63
|
+
|
64
|
+
RHC_(SERVER|ENDPOINT)
|
65
|
+
---------------------
|
66
|
+
This is the server/endpoint the tests will execute against.
|
67
|
+
|
68
|
+
If `RHC_SERVER` is set, it will set `RHC_ENDPOINT` to be
|
69
|
+
`https://#{RHC_SERVER}/broker/rest/api`.
|
70
|
+
|
71
|
+
If you need to point to another API endpoint, you can also specify the full
|
72
|
+
`RHC_ENDPOINT`.
|
73
|
+
|
74
|
+
If not set, these will default to the production OpenShift server.
|
30
75
|
|
76
|
+
RHC_(USERNAME|PASSWORD|NAMESPACE)
|
77
|
+
-----------------
|
31
78
|
In many cases, these tests will be run with an existing, pre-created user. The
|
32
79
|
tests should keep the resource needs of that user to a minimum, but in some
|
33
80
|
cases, the user might need to have an increased number of gears added to
|
34
81
|
support certain tests.
|
35
82
|
|
36
|
-
|
37
|
-
|
38
|
-
|
83
|
+
These variables allow the tests to be run with the defined credentials
|
84
|
+
instead of randomly generating new ones.
|
85
|
+
|
86
|
+
NO_CLEAN
|
87
|
+
--------
|
88
|
+
This option prevents the tests from deleting the existing apps in this
|
89
|
+
namespace before running the tests.
|
90
|
+
It also prevents the tests from replacing the existing
|
91
|
+
`~/.openshift/express.conf`.
|
39
92
|
|
40
|
-
|
93
|
+
If this is specified, the script will use values stored in `/tmp/rhc/(username|namespace)` (unless overridden by `RHC_(USERNAME|NAMESPACE)`).
|
41
94
|
|
42
95
|
Development Usage
|
43
96
|
=================
|
97
|
+
When developing new features, whether for the `rhc` tools or OpenShift
|
98
|
+
server, these tests will help to ensure the tools continue to function
|
99
|
+
properly.
|
44
100
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
101
|
+
Running Tests
|
102
|
+
-------------
|
103
|
+
First, and foremost, you will want be able to run the tests.
|
104
|
+
Often when you are developing new tests, you don't want to run the entire suite
|
105
|
+
each time.
|
106
|
+
There are two ways to run them.
|
49
107
|
|
50
|
-
|
108
|
+
1. The `rake` command may add additional functionality, such as coverage
|
109
|
+
reporting.
|
110
|
+
To run the test, simply run
|
51
111
|
|
112
|
+
```
|
113
|
+
<env variables> bundle exec rake features
|
114
|
+
```
|
52
115
|
|
53
|
-
|
54
|
-
|
116
|
+
1. Running the tests directly via `cucumber` gives you some more
|
117
|
+
flexibility as to which tests to run. You can run `cucumber` using any of the techniques [shown
|
118
|
+
here](https://github.com/cucumber/cucumber/wiki/Running-Features).
|
55
119
|
|
56
|
-
|
57
|
-
each time. However, the tests by default automatically clean up the test
|
58
|
-
applications that were created on the previous run. You can quickly develop
|
59
|
-
and interate on a single test by doing the following:
|
60
|
-
|
61
|
-
* Run the initialization portion of the test suite
|
120
|
+
For instance:
|
62
121
|
|
63
|
-
|
122
|
+
```
|
123
|
+
# This runs all scenarios with the @application tag that also do not
|
124
|
+
# have the @init tag
|
125
|
+
cucumber features -t @application -t ~@init
|
126
|
+
# This runs the scenario starting at a specific line in the file
|
127
|
+
cucumber features/application.feature:42
|
128
|
+
```
|
64
129
|
|
65
|
-
|
66
|
-
|
67
|
-
cucumber feature you wanted to test started on line 17, in your .feature file,
|
68
|
-
you would run
|
130
|
+
Developing tests
|
131
|
+
----------------
|
69
132
|
|
70
|
-
|
133
|
+
Due to their nature, some tests require previous state to
|
134
|
+
function properly.
|
135
|
+
For instance, in order to test adding cartridges to an application, an
|
136
|
+
application must exist first.
|
137
|
+
|
138
|
+
When the tests are run in order, this state is reused.
|
139
|
+
We have also devised a technique using before_hooks and backgrounds to
|
140
|
+
ensure the environment is in the correct state.
|
141
|
+
|
142
|
+
When a feature is run, there is generally a scenario tagged `@init` which does some sort of initialization step (such as creating an
|
143
|
+
application).
|
144
|
+
|
145
|
+
Normally, the other scenarios in the same feature will depend on this step to function
|
146
|
+
properly.
|
147
|
+
However, there are before_hooks defined for any `~@init` steps that
|
148
|
+
ensure that state is in place.
|
149
|
+
This way, you can run any scenario and know that you will have the same
|
150
|
+
state as if the `@init` step was run.
|
151
|
+
|
152
|
+
|
153
|
+
### Example
|
154
|
+
In our feature file, we may have something like this:
|
155
|
+
|
156
|
+
```
|
157
|
+
@demo
|
158
|
+
Feature: Demonstrating Hooks
|
159
|
+
|
160
|
+
@init
|
161
|
+
Scenario: Setting Up Demo
|
162
|
+
Given we are giving a demo
|
163
|
+
Then the demo directory should exist
|
164
|
+
|
165
|
+
Scenario: Running a Demo
|
166
|
+
Then we should start the demo
|
167
|
+
|
168
|
+
Scenario: Deleting a demo
|
169
|
+
Then the demo should be deleted
|
170
|
+
```
|
171
|
+
|
172
|
+
Notice we don't have another `Given` statement in our second or third scenario.
|
173
|
+
We take care of that in our before hooks.
|
174
|
+
If we were to run either of those scenarios on their own, they would fail.
|
175
|
+
We fix this by defining a step that can set the expected state if it
|
176
|
+
doesn't exist.
|
177
|
+
|
178
|
+
```
|
179
|
+
Given "a demo directory exists or is created" do
|
180
|
+
begin
|
181
|
+
Given "the demo directory exists"
|
182
|
+
rescue Spec::Expectations::ExpectationNotMetError
|
183
|
+
Then "create the demo directory"
|
184
|
+
end
|
185
|
+
end
|
186
|
+
```
|
187
|
+
|
188
|
+
Now we can define a `before_hook` that runs our steps before any
|
189
|
+
scenarios that are not tagged `@init`.
|
190
|
+
|
191
|
+
```
|
192
|
+
Before('@demo','~@init') do
|
193
|
+
Given "a demo directory exists or is created"
|
194
|
+
end
|
195
|
+
```
|
196
|
+
|
197
|
+
After following these steps, we can confidently run any of our scenarios
|
198
|
+
and know that they will be in the state they expect.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@application @domain_required
|
2
|
+
Feature: Application Operations
|
3
|
+
|
4
|
+
@init
|
5
|
+
Scenario: Application Creation
|
6
|
+
When a php-5.3 application is created
|
7
|
+
Then the application should be accessible
|
8
|
+
|
9
|
+
# The state in these examples should be able to be broken into before hooks when we update cucumber
|
10
|
+
Scenario Outline: Running Application Commands
|
11
|
+
Given we have a <state> application
|
12
|
+
When the application is <command>
|
13
|
+
Then <what> should <status>
|
14
|
+
|
15
|
+
# Breaking these examples up so they can flow logically, but also be run individually
|
16
|
+
Examples:
|
17
|
+
| state | command | what | status |
|
18
|
+
| running | restarted | the application | be accessible |
|
19
|
+
| running | snapshot | the snapshot | be found |
|
20
|
+
| running | tidied | it | succeed |
|
21
|
+
| running | shown | it | succeed |
|
22
|
+
| running | stopped | the application | not be accessible |
|
23
|
+
| stopped | started | the application | be accessible |
|
24
|
+
| running | destroyed | the application | not exist |
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@single_cartridge @domain_required
|
2
|
+
Feature: Single Cartridge Tests
|
3
|
+
|
4
|
+
# Need to keep these outlines duplicated until we update cucumber to allow tagged examples
|
5
|
+
|
6
|
+
@init
|
7
|
+
Scenario Outline: Cartridge Commands
|
8
|
+
When the <type> cartridge is <command>
|
9
|
+
Then the <type> cartridge should be <status>
|
10
|
+
|
11
|
+
Examples:
|
12
|
+
| type | command | status |
|
13
|
+
| mysql-5.1 | added | running |
|
14
|
+
|
15
|
+
Scenario Outline: Cartridge Commands
|
16
|
+
Given we have a <state> mysql-5.1 cartridge
|
17
|
+
When the mysql-5.1 cartridge is <command>
|
18
|
+
Then the mysql-5.1 cartridge should be <status>
|
19
|
+
|
20
|
+
Examples:
|
21
|
+
| state | command | status |
|
22
|
+
| running | restarted | running |
|
23
|
+
| running | stopped | stopped |
|
24
|
+
| stopped | started | running |
|
@@ -0,0 +1,29 @@
|
|
1
|
+
@domain @client_tools_required
|
2
|
+
Feature: Existing Domain Operations
|
3
|
+
|
4
|
+
@init
|
5
|
+
Scenario: Domain Creation
|
6
|
+
When a new domain is needed and created
|
7
|
+
Then the domain should be reserved
|
8
|
+
|
9
|
+
Scenario: Domain Update
|
10
|
+
When domain is updated
|
11
|
+
Then the domain should be reserved
|
12
|
+
|
13
|
+
Scenario: Domain Show
|
14
|
+
When rhc domain is run
|
15
|
+
When rhc domain show is run
|
16
|
+
Then the default domain action output should equal the show action output
|
17
|
+
|
18
|
+
Scenario: Domain Create Fails
|
19
|
+
When rhc domain create is called
|
20
|
+
Then the domain command should fail with an exitcode of 128
|
21
|
+
|
22
|
+
Scenario: Domain Delete
|
23
|
+
When domain is deleted
|
24
|
+
Then domains should be empty
|
25
|
+
|
26
|
+
Scenario: Domain Update Fails
|
27
|
+
When domain is deleted
|
28
|
+
When domain is updated
|
29
|
+
Then the domain command should fail with an exitcode of 127
|
data/features/lib/rhc_helper.rb
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'active_support/ordered_hash'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
### Some shared constant declarations
|
6
|
+
module RHCHelper
|
7
|
+
TEMP_DIR = File.join(Dir.tmpdir, "rhc") unless const_defined?(:TEMP_DIR)
|
8
|
+
# The regex to parse the ssh output from the create app results
|
9
|
+
SSH_OUTPUT_PATTERN = %r|ssh://([^@]+)@([^/]+)| unless const_defined?(:SSH_OUTPUT_PATTERN)
|
10
|
+
# Regex to parse passwords out of logging messages
|
11
|
+
PASSWORD_REGEX = / -p [^\s]* / unless const_defined?(:PASSWORD_REGEX)
|
12
|
+
end
|
13
|
+
|
1
14
|
require 'rhc_helper/loggable'
|
2
15
|
require 'rhc_helper/commandify'
|
3
16
|
require 'rhc_helper/httpify'
|
@@ -5,3 +18,4 @@ require 'rhc_helper/persistable'
|
|
5
18
|
require 'rhc_helper/runnable'
|
6
19
|
require 'rhc_helper/app'
|
7
20
|
require 'rhc_helper/domain'
|
21
|
+
require 'rhc_helper/sshkey'
|
@@ -1,12 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require 'rhc-rest'
|
1
|
+
require 'rhc/rest'
|
3
2
|
|
4
3
|
module RHCHelper
|
5
|
-
#
|
6
|
-
# Constant Definitions
|
7
|
-
#
|
8
|
-
TEMP_DIR = File.join(Dir.tmpdir, "rhc")
|
9
|
-
|
10
4
|
#
|
11
5
|
# A class to help maintain the state from rhc calls and helper
|
12
6
|
# methods around application management.
|
@@ -55,7 +49,7 @@ module RHCHelper
|
|
55
49
|
|
56
50
|
def self.create_unique(type, prefix="test")
|
57
51
|
# Get a REST client to verify the application name
|
58
|
-
client =
|
52
|
+
client = RHC::Rest::Client.new($end_point, $username, $password)
|
59
53
|
|
60
54
|
# Cleanup all test applications
|
61
55
|
test_names = []
|
@@ -1,12 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require 'rhc-rest'
|
1
|
+
require 'rhc/rest'
|
3
2
|
|
4
3
|
module RHCHelper
|
5
|
-
#
|
6
|
-
# Constant Definitions
|
7
|
-
#
|
8
|
-
TEMP_DIR = File.join(Dir.tmpdir, "rhc")
|
9
|
-
|
10
4
|
#
|
11
5
|
# A class to help maintain the state from rhc calls and helper
|
12
6
|
# methods around cartridge management.
|
@@ -48,7 +48,7 @@ module RHCHelper
|
|
48
48
|
end
|
49
49
|
|
50
50
|
# Print out the command arguments based on the state of the application instance
|
51
|
-
def get_args(cmd,
|
51
|
+
def get_args(cmd, arg0=nil, debug=true)
|
52
52
|
args = " "
|
53
53
|
args << "-l #{$username} "
|
54
54
|
args << "-p #{$password} "
|
@@ -80,8 +80,12 @@ module RHCHelper
|
|
80
80
|
raise "No alias set" unless @alias
|
81
81
|
args << "--alias #{@alias} "
|
82
82
|
when /cartridge/
|
83
|
-
raise "No cartridge supplied" unless
|
84
|
-
args << "-c #{
|
83
|
+
raise "No cartridge supplied" unless arg0
|
84
|
+
args << "-c #{arg0}"
|
85
|
+
when /sshkey/
|
86
|
+
# in RHCHelper::Sshkey, we pass *args to method_missing here, so that
|
87
|
+
# we _know_ that arg0 is an Array.
|
88
|
+
args << arg0.first if arg0.first
|
85
89
|
end
|
86
90
|
|
87
91
|
args.rstrip
|
@@ -115,9 +119,6 @@ module RHCHelper
|
|
115
119
|
end
|
116
120
|
end
|
117
121
|
|
118
|
-
# The regex to parse the ssh output from the create app results
|
119
|
-
SSH_OUTPUT_PATTERN = %r|ssh://([^@]+)@([^/]+)|
|
120
|
-
|
121
122
|
#
|
122
123
|
# Begin Post Processing Callbacks
|
123
124
|
#
|
@@ -180,4 +181,34 @@ module RHCHelper
|
|
180
181
|
@exitcode = exitcode
|
181
182
|
end
|
182
183
|
|
184
|
+
def sshkey_callback(exitcode, stdout, stderr, arg)
|
185
|
+
@sshkey_output = stdout
|
186
|
+
@exitcode = exitcode
|
187
|
+
end
|
188
|
+
|
189
|
+
def sshkey_add_callback(exitcode, stdout, stderr, arg)
|
190
|
+
@sshkey_output = stdout
|
191
|
+
@exitcode = exitcode
|
192
|
+
end
|
193
|
+
|
194
|
+
def sshkey_list_callback(exitcode, stdout, stderr, arg)
|
195
|
+
@sshkey_output = stdout
|
196
|
+
@exitcode = exitcode
|
197
|
+
end
|
198
|
+
|
199
|
+
def sshkey_show_callback(exitcode, stdout, stderr, arg)
|
200
|
+
@sshkey_output = stdout
|
201
|
+
@exitcode = exitcode
|
202
|
+
end
|
203
|
+
|
204
|
+
def sshkey_update_callback(exitcode, stdout, stderr, arg)
|
205
|
+
@sshkey_output = stdout
|
206
|
+
@exitcode = exitcode
|
207
|
+
end
|
208
|
+
|
209
|
+
def sshkey_delete_callback(exitcode, stdout, stderr, arg)
|
210
|
+
@sshkey_output = stdout
|
211
|
+
@exitcode = exitcode
|
212
|
+
end
|
213
|
+
|
183
214
|
end
|