hammer_cli_foreman 0.2.0 → 0.3.0
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.
Potentially problematic release.
This version of hammer_cli_foreman might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/doc/developer_docs.md +1 -0
- data/doc/host_create.md +7 -2
- data/doc/release_notes.md +9 -0
- data/doc/using_hammer_cli_foreman_command.md +92 -0
- data/lib/hammer_cli_foreman/commands.rb +22 -21
- data/lib/hammer_cli_foreman/exception_handler.rb +3 -3
- data/lib/hammer_cli_foreman/host.rb +1 -1
- data/lib/hammer_cli_foreman/option_builders.rb +1 -0
- data/lib/hammer_cli_foreman/template.rb +15 -0
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/de/hammer-cli-foreman.edit.po +41 -80
- data/locale/de/hammer-cli-foreman.po +22 -21
- data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en/hammer-cli-foreman.edit.po +7 -8
- data/locale/en/hammer-cli-foreman.po +4 -4
- data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en_GB/hammer-cli-foreman.edit.po +10 -10
- data/locale/en_GB/hammer-cli-foreman.po +18 -18
- data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/es/hammer-cli-foreman.edit.po +47 -110
- data/locale/es/hammer-cli-foreman.po +1 -1
- data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/fr/hammer-cli-foreman.edit.po +45 -109
- data/locale/fr/hammer-cli-foreman.po +1 -1
- data/locale/hammer-cli-foreman.pot +9 -9
- data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/it/hammer-cli-foreman.edit.po +35 -75
- data/locale/it/hammer-cli-foreman.po +2 -2
- data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ja/hammer-cli-foreman.edit.po +81 -120
- data/locale/ja/hammer-cli-foreman.po +1 -1
- data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ko/hammer-cli-foreman.edit.po +35 -75
- data/locale/ko/hammer-cli-foreman.po +1 -1
- data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/pt_BR/hammer-cli-foreman.edit.po +51 -106
- data/locale/pt_BR/hammer-cli-foreman.po +1 -1
- data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ru/hammer-cli-foreman.edit.po +36 -76
- data/locale/ru/hammer-cli-foreman.po +91 -90
- data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_CN/hammer-cli-foreman.edit.po +35 -75
- data/locale/zh_CN/hammer-cli-foreman.po +1 -1
- data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_TW/hammer-cli-foreman.edit.po +35 -75
- data/locale/zh_TW/hammer-cli-foreman.po +1 -1
- data/test/unit/domain_test.rb +2 -2
- data/test/unit/exception_handler_test.rb +13 -1
- data/test/unit/host_test.rb +7 -5
- data/test/unit/hostgroup_test.rb +2 -3
- data/test/unit/operating_system_test.rb +2 -2
- metadata +6 -4
data/test/unit/domain_test.rb
CHANGED
@@ -98,7 +98,7 @@ describe HammerCLIForeman::Domain do
|
|
98
98
|
|
99
99
|
context "parameters" do
|
100
100
|
it_should_accept "name, value and domain name", ["--name=name", "--value=val", "--domain=name"]
|
101
|
-
it_should_accept "name, value and domain id", ["--name=name", "--value=val", "--domain-id=
|
101
|
+
it_should_accept "name, value and domain id", ["--name=name", "--value=val", "--domain-id=1"]
|
102
102
|
# it_should_fail_with "name missing", ["--value=val", "--domain=name"]
|
103
103
|
# it_should_fail_with "value missing", ["--name=name", "--domain=name"]
|
104
104
|
# it_should_fail_with "domain name or id missing", ["--name=name", "--value=val"]
|
@@ -114,7 +114,7 @@ describe HammerCLIForeman::Domain do
|
|
114
114
|
|
115
115
|
context "parameters" do
|
116
116
|
it_should_accept "name and domain name", ["--name=param", "--domain=name"]
|
117
|
-
it_should_accept "name and domain id", ["--name=param", "--domain-id=
|
117
|
+
it_should_accept "name and domain id", ["--name=param", "--domain-id=1"]
|
118
118
|
|
119
119
|
# it_should_fail_with "name missing", ["--domain=name"]
|
120
120
|
# it_should_fail_with "domain name or id missing", ["--name=param"]
|
@@ -98,7 +98,19 @@ describe HammerCLIForeman::ExceptionHandler do
|
|
98
98
|
ex = RestClient::InternalServerError.new(response)
|
99
99
|
ex.stubs(:message).returns(response)
|
100
100
|
|
101
|
-
output.expects(:print_error).with(
|
101
|
+
output.expects(:print_error).with(heading, "Unformatted\nlines\n")
|
102
|
+
err_code = handler.handle_exception(ex, :heading => heading)
|
103
|
+
err_code.must_equal HammerCLI::EX_SOFTWARE
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should print exception message on internal error exception with message that is not nested" do
|
107
|
+
response = <<-RESPONSE
|
108
|
+
{"message":"Some internal exception"}
|
109
|
+
RESPONSE
|
110
|
+
ex = RestClient::InternalServerError.new(response)
|
111
|
+
ex.stubs(:message).returns(response)
|
112
|
+
|
113
|
+
output.expects(:print_error).with(heading, "Some internal exception")
|
102
114
|
err_code = handler.handle_exception(ex, :heading => heading)
|
103
115
|
err_code.must_equal HammerCLI::EX_SOFTWARE
|
104
116
|
end
|
data/test/unit/host_test.rb
CHANGED
@@ -217,7 +217,7 @@ describe HammerCLIForeman::Host do
|
|
217
217
|
it_should_fail_with "operatingsystem_id missing",
|
218
218
|
["--name=host", "--environment-id=1", "--architecture-id=1", "--domain-id=1", "--puppet-proxy-id=1", "--interface=primary=true,provision=true"]
|
219
219
|
it_should_accept "only hostgroup name", ["--hostgroup=example", "--name=host", "--interface=primary=true,provision=true"]
|
220
|
-
it_should_accept "only hostgroup ID", ["--hostgroup-id=
|
220
|
+
it_should_accept "only hostgroup ID", ["--hostgroup-id=1", "--name=host", "--interface=primary=true,provision=true"]
|
221
221
|
|
222
222
|
with_params ["--name=host", "--environment-id=1", "--architecture-id=1", "--domain-id=1", "--puppet-proxy-id=1", "--operatingsystem-id=1",
|
223
223
|
"--ip=1.2.3.4", "--mac=11:22:33:44:55:66", "--medium-id=1", "--partition-table-id=1", "--subnet-id=1",
|
@@ -231,6 +231,10 @@ describe HammerCLIForeman::Host do
|
|
231
231
|
it_should_call_action_and_test_params(:create) { |par| par["host"]["interfaces_attributes"]["0"]["provision"] == "true" }
|
232
232
|
end
|
233
233
|
|
234
|
+
with_params ["--name=host", "--hostgroup-id=1", "--interface=primary=true,provision=true", "--parameters=servers=[pool.ntp.org,ntp.time.org]"] do
|
235
|
+
it_should_call_action_and_test_params(:create) { |par| par["host"]["host_parameters_attributes"][0]["value"] == "[\"pool.ntp.org\", \"ntp.time.org\"]" }
|
236
|
+
end
|
237
|
+
|
234
238
|
it_should_fail_with "primary interface missing", ["--hostgroup-id=example", "--interface=primary=true"]
|
235
239
|
it_should_fail_with "provision interface missing", ["--hostgroup-id=example", "--interface=provision=true"]
|
236
240
|
end
|
@@ -295,7 +299,7 @@ describe HammerCLIForeman::Host do
|
|
295
299
|
|
296
300
|
context "parameters" do
|
297
301
|
it_should_accept "name, value and host name", ["--name=name", "--value=val", "--host=name"]
|
298
|
-
it_should_accept "name, value and host id", ["--name=name", "--value=val", "--host-id=
|
302
|
+
it_should_accept "name, value and host id", ["--name=name", "--value=val", "--host-id=1"]
|
299
303
|
it_should_fail_with "name missing", ["--value=val", "--host=name"]
|
300
304
|
it_should_fail_with "value missing", ["--name=name", "--host=name"]
|
301
305
|
# it_should_fail_with "host name or id missing", ["--name=name", "--value=val"]
|
@@ -311,7 +315,7 @@ describe HammerCLIForeman::Host do
|
|
311
315
|
|
312
316
|
context "parameters" do
|
313
317
|
it_should_accept "name and host name", ["--name=name", "--host=name"]
|
314
|
-
it_should_accept "name and host id", ["--name=name", "--host-id=
|
318
|
+
it_should_accept "name and host id", ["--name=name", "--host-id=1"]
|
315
319
|
# it_should_fail_with "name missing", ["--host=name"]
|
316
320
|
# it_should_fail_with "host name or id missing", ["--name=name"]
|
317
321
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
@@ -383,5 +387,3 @@ describe HammerCLIForeman::Host do
|
|
383
387
|
end
|
384
388
|
|
385
389
|
end
|
386
|
-
|
387
|
-
|
data/test/unit/hostgroup_test.rb
CHANGED
@@ -96,7 +96,7 @@ describe HammerCLIForeman::Hostgroup do
|
|
96
96
|
let(:cmd) { HammerCLIForeman::Hostgroup::SetParameterCommand.new("", ctx) }
|
97
97
|
|
98
98
|
context "parameters" do
|
99
|
-
it_should_accept "name, value and hostgroup id", ["--name=name", "--value=val", "--hostgroup-id=
|
99
|
+
it_should_accept "name, value and hostgroup id", ["--name=name", "--value=val", "--hostgroup-id=1"]
|
100
100
|
it_should_fail_with "name missing", ["--value=val", "--hostgroup-id=1"]
|
101
101
|
it_should_fail_with "value missing", ["--name=name", "--hostgroup-id=1"]
|
102
102
|
# it_should_fail_with "hostgroup id missing", ["--name=name", "--value=val"] # TODO: temporarily disabled, parameters are checked in the id resolver
|
@@ -110,7 +110,7 @@ describe HammerCLIForeman::Hostgroup do
|
|
110
110
|
let(:cmd) { HammerCLIForeman::Hostgroup::DeleteParameterCommand.new("", ctx) }
|
111
111
|
|
112
112
|
context "parameters" do
|
113
|
-
it_should_accept "name and hostgroup id", ["--name=param", "--hostgroup-id=
|
113
|
+
it_should_accept "name and hostgroup id", ["--name=param", "--hostgroup-id=1"]
|
114
114
|
# it_should_fail_with "name missing", ["--hostgroup-id=id"]
|
115
115
|
# it_should_fail_with "hostgroup id missing", ["--name=param"]
|
116
116
|
# TODO: temporarily disabled, parameters are checked in the id resolver
|
@@ -152,4 +152,3 @@ describe HammerCLIForeman::Hostgroup do
|
|
152
152
|
end
|
153
153
|
|
154
154
|
end
|
155
|
-
|
@@ -124,7 +124,7 @@ describe HammerCLIForeman::OperatingSystem do
|
|
124
124
|
let(:cmd) { HammerCLIForeman::OperatingSystem::SetParameterCommand.new("", ctx) }
|
125
125
|
|
126
126
|
context "parameters" do
|
127
|
-
it_should_accept "name, value and os id", ["--name=domain", "--value=val", "--operatingsystem-id=
|
127
|
+
it_should_accept "name, value and os id", ["--name=domain", "--value=val", "--operatingsystem-id=1"]
|
128
128
|
it_should_accept "name, value and os title", ["--name=domain", "--value=val", "--operatingsystem=Rhel 6.5"]
|
129
129
|
# it_should_fail_with "name missing", ["--value=val", "--operatingsystem-id=id"]
|
130
130
|
# it_should_fail_with "value missing", ["--name=name", "--operatingsystem-id=id"]
|
@@ -140,7 +140,7 @@ describe HammerCLIForeman::OperatingSystem do
|
|
140
140
|
let(:cmd) { HammerCLIForeman::OperatingSystem::DeleteParameterCommand.new("", ctx) }
|
141
141
|
|
142
142
|
context "parameters" do
|
143
|
-
it_should_accept "name and os id", ["--name=domain", "--operatingsystem-id=
|
143
|
+
it_should_accept "name and os id", ["--name=domain", "--operatingsystem-id=1"]
|
144
144
|
it_should_accept "name and os title", ["--name=domain", "--operatingsystem=Rhel 6.5"]
|
145
145
|
# it_should_fail_with "name missing", ["--operatingsystem-id=id"]
|
146
146
|
# it_should_fail_with "os id missing", ["--name=name"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli_foreman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomáš Strachota
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hammer_cli
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.3.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.3.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: apipie-bindings
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,7 @@ executables: []
|
|
66
66
|
extensions: []
|
67
67
|
extra_rdoc_files:
|
68
68
|
- doc/configuration.md
|
69
|
+
- doc/using_hammer_cli_foreman_command.md
|
69
70
|
- doc/developer_docs.md
|
70
71
|
- doc/option_builder.md
|
71
72
|
- doc/host_create.md
|
@@ -81,6 +82,7 @@ files:
|
|
81
82
|
- doc/name_id_resolution.md
|
82
83
|
- doc/option_builder.md
|
83
84
|
- doc/release_notes.md
|
85
|
+
- doc/using_hammer_cli_foreman_command.md
|
84
86
|
- lib/hammer_cli_foreman.rb
|
85
87
|
- lib/hammer_cli_foreman/architecture.rb
|
86
88
|
- lib/hammer_cli_foreman/associating_commands.rb
|