hammer_cli_foreman 0.0.18 → 0.1.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/lib/hammer_cli_foreman.rb +39 -27
- data/lib/hammer_cli_foreman/architecture.rb +14 -14
- data/lib/hammer_cli_foreman/associating_commands.rb +46 -40
- data/lib/hammer_cli_foreman/auth.rb +49 -0
- data/lib/hammer_cli_foreman/commands.rb +82 -29
- data/lib/hammer_cli_foreman/common_parameter.rb +13 -17
- data/lib/hammer_cli_foreman/compute_resource.rb +23 -23
- data/lib/hammer_cli_foreman/credentials.rb +36 -0
- data/lib/hammer_cli_foreman/domain.rb +32 -35
- data/lib/hammer_cli_foreman/environment.rb +14 -19
- data/lib/hammer_cli_foreman/exception_handler.rb +30 -8
- data/lib/hammer_cli_foreman/fact.rb +5 -5
- data/lib/hammer_cli_foreman/host.rb +178 -105
- data/lib/hammer_cli_foreman/hostgroup.rb +59 -37
- data/lib/hammer_cli_foreman/i18n.rb +24 -0
- data/lib/hammer_cli_foreman/image.rb +24 -24
- data/lib/hammer_cli_foreman/location.rb +13 -13
- data/lib/hammer_cli_foreman/media.rb +21 -16
- data/lib/hammer_cli_foreman/model.rb +16 -16
- data/lib/hammer_cli_foreman/operating_system.rb +39 -39
- data/lib/hammer_cli_foreman/organization.rb +13 -13
- data/lib/hammer_cli_foreman/output/fields.rb +2 -2
- data/lib/hammer_cli_foreman/output/formatters.rb +15 -4
- data/lib/hammer_cli_foreman/parameter.rb +13 -11
- data/lib/hammer_cli_foreman/partition_table.rb +17 -18
- data/lib/hammer_cli_foreman/puppet_class.rb +9 -9
- data/lib/hammer_cli_foreman/report.rb +38 -38
- data/lib/hammer_cli_foreman/resource_supported_test.rb +1 -1
- data/lib/hammer_cli_foreman/smart_class_parameter.rb +36 -36
- data/lib/hammer_cli_foreman/smart_proxy.rb +22 -21
- data/lib/hammer_cli_foreman/subnet.rb +29 -31
- data/lib/hammer_cli_foreman/template.rb +45 -43
- data/lib/hammer_cli_foreman/user.rb +20 -23
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/locale/Makefile +64 -0
- data/locale/hammer-cli-foreman.pot +1573 -0
- data/locale/zanata.xml +29 -0
- data/test/unit/apipie_resource_mock.rb +44 -72
- data/test/unit/architecture_test.rb +1 -2
- data/test/unit/commands_test.rb +23 -21
- data/test/unit/common_parameter_test.rb +15 -10
- data/test/unit/compute_resource_test.rb +1 -2
- data/test/unit/credentials_test.rb +46 -0
- data/test/unit/data/1.4/foreman_api.json +10387 -0
- data/test/unit/domain_test.rb +2 -5
- data/test/unit/environment_test.rb +2 -3
- data/test/unit/exception_handler_test.rb +29 -4
- data/test/unit/fact_test.rb +0 -1
- data/test/unit/helpers/command.rb +20 -4
- data/test/unit/helpers/resource_disabled.rb +2 -2
- data/test/unit/host_test.rb +24 -12
- data/test/unit/hostgroup_test.rb +7 -8
- data/test/unit/image_test.rb +6 -7
- data/test/unit/location_test.rb +9 -5
- data/test/unit/media_test.rb +1 -9
- data/test/unit/model_test.rb +1 -3
- data/test/unit/operating_system_test.rb +7 -9
- data/test/unit/organization_test.rb +12 -6
- data/test/unit/output/formatters_test.rb +5 -0
- data/test/unit/partition_table_test.rb +1 -2
- data/test/unit/puppet_class_test.rb +2 -3
- data/test/unit/report_test.rb +1 -2
- data/test/unit/smart_class_parameter_test.rb +9 -4
- data/test/unit/smart_proxy_test.rb +1 -2
- data/test/unit/subnet_test.rb +2 -3
- data/test/unit/template_test.rb +23 -8
- data/test/unit/test_helper.rb +13 -0
- data/test/unit/test_output_adapter.rb +1 -1
- data/test/unit/user_test.rb +1 -2
- metadata +17 -7
data/test/unit/model_test.rb
CHANGED
@@ -7,7 +7,6 @@ describe HammerCLIForeman::Model do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
cmd.class.resource ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
10
|
cmd.stubs(:name_to_id).returns(1)
|
12
11
|
end
|
13
12
|
|
@@ -21,7 +20,7 @@ describe HammerCLIForeman::Model do
|
|
21
20
|
end
|
22
21
|
|
23
22
|
context "output" do
|
24
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
23
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
25
24
|
|
26
25
|
it_should_print_n_records
|
27
26
|
it_should_print_column "Name"
|
@@ -29,7 +28,6 @@ describe HammerCLIForeman::Model do
|
|
29
28
|
it_should_print_column "Vendor class"
|
30
29
|
it_should_print_column "HW model"
|
31
30
|
end
|
32
|
-
|
33
31
|
end
|
34
32
|
|
35
33
|
|
@@ -7,15 +7,15 @@ describe HammerCLIForeman::OperatingSystem do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
resource_mock = ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
|
-
resource_mock.stub_method(:index, [])
|
12
|
-
resource_mock.stub_method(:show, {"operatingsystem" => {}})
|
13
|
-
cmd.class.resource resource_mock
|
14
10
|
cmd.stubs(:name_to_id).returns(1)
|
15
11
|
end
|
16
12
|
|
17
13
|
context "ListCommand" do
|
18
14
|
|
15
|
+
before :each do
|
16
|
+
ResourceMocks.operatingsystems
|
17
|
+
end
|
18
|
+
|
19
19
|
let(:cmd) { HammerCLIForeman::OperatingSystem::ListCommand.new("", ctx) }
|
20
20
|
|
21
21
|
context "parameters" do
|
@@ -24,7 +24,7 @@ describe HammerCLIForeman::OperatingSystem do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
context "output" do
|
27
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
27
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
28
28
|
|
29
29
|
it_should_print_n_records
|
30
30
|
it_should_print_column "Name"
|
@@ -115,15 +115,13 @@ describe HammerCLIForeman::OperatingSystem do
|
|
115
115
|
context "SetParameterCommand" do
|
116
116
|
|
117
117
|
before :each do
|
118
|
-
|
119
|
-
resource_mock.stub_method(:index, [])
|
120
|
-
cmd.class.resource resource_mock
|
118
|
+
ResourceMocks.operatingsystems
|
121
119
|
end
|
122
120
|
|
123
121
|
let(:cmd) { HammerCLIForeman::OperatingSystem::SetParameterCommand.new("", ctx) }
|
124
122
|
|
125
123
|
context "parameters" do
|
126
|
-
it_should_accept "name, value and os id", ["--name=
|
124
|
+
it_should_accept "name, value and os id", ["--name=domain", "--value=val", "--os-id=id"]
|
127
125
|
it_should_fail_with "name missing", ["--value=val", "--os-id=id"]
|
128
126
|
it_should_fail_with "value missing", ["--name=name", "--os-id=id"]
|
129
127
|
it_should_fail_with "os id missing", ["--name=name", "--value=val"]
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
2
|
require File.join(File.dirname(__FILE__), 'helpers/resource_disabled')
|
3
|
+
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
|
4
|
+
|
3
5
|
|
4
6
|
describe HammerCLIForeman::Organization do
|
5
7
|
|
@@ -7,15 +9,15 @@ describe HammerCLIForeman::Organization do
|
|
7
9
|
extend ResourceDisabled
|
8
10
|
|
9
11
|
before :each do
|
10
|
-
resource_mock = ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
|
-
resource_mock.stub_method(:index, [])
|
12
|
-
resource_mock.stub_method(:show, {})
|
13
|
-
cmd.class.resource resource_mock
|
14
12
|
cmd.stubs(:name_to_id).returns(1)
|
15
13
|
end
|
16
14
|
|
17
15
|
context "ListCommand" do
|
18
16
|
|
17
|
+
before :each do
|
18
|
+
ResourceMocks.organizations_index
|
19
|
+
end
|
20
|
+
|
19
21
|
let(:cmd) { HammerCLIForeman::Organization::ListCommand.new("", ctx) }
|
20
22
|
|
21
23
|
context "parameters" do
|
@@ -24,7 +26,7 @@ describe HammerCLIForeman::Organization do
|
|
24
26
|
end
|
25
27
|
|
26
28
|
context "output" do
|
27
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
29
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
28
30
|
|
29
31
|
it_should_print_n_records
|
30
32
|
it_should_print_column "Name"
|
@@ -37,6 +39,10 @@ describe HammerCLIForeman::Organization do
|
|
37
39
|
|
38
40
|
context "InfoCommand" do
|
39
41
|
|
42
|
+
before :each do
|
43
|
+
ResourceMocks.organizations_show
|
44
|
+
end
|
45
|
+
|
40
46
|
let(:cmd) { HammerCLIForeman::Organization::InfoCommand.new("", ctx) }
|
41
47
|
|
42
48
|
context "parameters" do
|
@@ -103,7 +109,7 @@ describe HammerCLIForeman::Organization do
|
|
103
109
|
it_should_fail_with "name or id missing", ["--new-name=org2"]
|
104
110
|
end
|
105
111
|
|
106
|
-
|
112
|
+
with_params ["--id=1"] do
|
107
113
|
it_should_fail_when_disabled
|
108
114
|
end
|
109
115
|
end
|
@@ -22,6 +22,11 @@ describe HammerCLIForeman::Output::Formatters::ServerFormatter do
|
|
22
22
|
formatter.format({ :name => 'Server', :url => "URL"}).must_equal 'Server (URL)'
|
23
23
|
end
|
24
24
|
|
25
|
+
it "formats the server" do
|
26
|
+
formatter = HammerCLIForeman::Output::Formatters::ServerFormatter.new
|
27
|
+
formatter.format({ 'name' => 'Server', 'url' => "URL"}).must_equal 'Server (URL)'
|
28
|
+
end
|
29
|
+
|
25
30
|
it "recovers when server is nil" do
|
26
31
|
formatter = HammerCLIForeman::Output::Formatters::ServerFormatter.new
|
27
32
|
formatter.format(nil).must_equal nil
|
@@ -8,7 +8,6 @@ describe HammerCLIForeman::PartitionTable do
|
|
8
8
|
extend CommandTestHelper
|
9
9
|
|
10
10
|
before :each do
|
11
|
-
cmd.class.resource ApipieResourceMock.new(cmd.class.resource.resource_class)
|
12
11
|
cmd.stubs(:name_to_id).returns(1)
|
13
12
|
|
14
13
|
::File.stubs(:read).returns("FILE_CONTENT")
|
@@ -24,7 +23,7 @@ describe HammerCLIForeman::PartitionTable do
|
|
24
23
|
end
|
25
24
|
|
26
25
|
context "output" do
|
27
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
26
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
28
27
|
|
29
28
|
it_should_print_n_records
|
30
29
|
it_should_print_columns ["Id", "Name", "OS Family"]
|
@@ -7,7 +7,6 @@ describe HammerCLIForeman::PuppetClass do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
cmd.class.resource ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
10
|
cmd.stubs(:name_to_id).returns(1)
|
12
11
|
end
|
13
12
|
|
@@ -22,7 +21,7 @@ describe HammerCLIForeman::PuppetClass do
|
|
22
21
|
end
|
23
22
|
|
24
23
|
context "output" do
|
25
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
24
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
26
25
|
|
27
26
|
it_should_print_n_records
|
28
27
|
it_should_print_column "Id"
|
@@ -55,7 +54,7 @@ describe HammerCLIForeman::PuppetClass do
|
|
55
54
|
context "SCParamsCommand" do
|
56
55
|
|
57
56
|
before :each do
|
58
|
-
|
57
|
+
ResourceMocks.smart_class_parameters_index
|
59
58
|
end
|
60
59
|
|
61
60
|
let(:cmd) { HammerCLIForeman::PuppetClass::SCParamsCommand.new("", ctx) }
|
data/test/unit/report_test.rb
CHANGED
@@ -7,7 +7,6 @@ describe HammerCLIForeman::Report do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
cmd.class.resource ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
10
|
cmd.stubs(:name_to_id).returns(1)
|
12
11
|
end
|
13
12
|
|
@@ -21,7 +20,7 @@ describe HammerCLIForeman::Report do
|
|
21
20
|
end
|
22
21
|
|
23
22
|
context "output" do
|
24
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
23
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
25
24
|
|
26
25
|
it_should_print_n_records
|
27
26
|
it_should_print_column "Id"
|
@@ -7,12 +7,15 @@ describe HammerCLIForeman::SmartClassParameter do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
cmd.class.resource ResourceMocks.smart_class_parameter
|
11
10
|
cmd.stubs(:name_to_id).returns(1)
|
12
11
|
end
|
13
12
|
|
14
13
|
context "ListCommand" do
|
15
14
|
|
15
|
+
before :each do
|
16
|
+
ResourceMocks.smart_class_parameters_index
|
17
|
+
end
|
18
|
+
|
16
19
|
let(:cmd) { HammerCLIForeman::SmartClassParameter::ListCommand.new("", ctx) }
|
17
20
|
|
18
21
|
context "parameters" do
|
@@ -25,7 +28,7 @@ describe HammerCLIForeman::SmartClassParameter do
|
|
25
28
|
end
|
26
29
|
|
27
30
|
context "output" do
|
28
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
31
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
29
32
|
|
30
33
|
it_should_print_n_records
|
31
34
|
it_should_print_column "Id"
|
@@ -41,15 +44,17 @@ describe HammerCLIForeman::SmartClassParameter do
|
|
41
44
|
|
42
45
|
context "InfoCommand" do
|
43
46
|
|
44
|
-
|
47
|
+
before :each do
|
48
|
+
ResourceMocks.smart_class_parameters_show
|
49
|
+
end
|
45
50
|
|
51
|
+
let(:cmd) { HammerCLIForeman::SmartClassParameter::InfoCommand.new("", ctx) }
|
46
52
|
|
47
53
|
context "parameters" do
|
48
54
|
it_should_accept "id", ["--id=1"]
|
49
55
|
it_should_accept "name", ["--name=param"]
|
50
56
|
it_should_fail_with "no arguments"
|
51
57
|
end
|
52
|
-
|
53
58
|
end
|
54
59
|
|
55
60
|
|
@@ -7,7 +7,6 @@ describe HammerCLIForeman::SmartProxy do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
cmd.class.resource ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
10
|
cmd.stubs(:name_to_id).returns(1)
|
12
11
|
end
|
13
12
|
|
@@ -21,7 +20,7 @@ describe HammerCLIForeman::SmartProxy do
|
|
21
20
|
end
|
22
21
|
|
23
22
|
context "output" do
|
24
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
23
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
25
24
|
|
26
25
|
it_should_print_n_records
|
27
26
|
it_should_print_columns ["Id", "Name", "URL"]
|
data/test/unit/subnet_test.rb
CHANGED
@@ -7,7 +7,6 @@ describe HammerCLIForeman::Subnet do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
cmd.class.resource ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
10
|
cmd.stubs(:name_to_id).returns(1)
|
12
11
|
end
|
13
12
|
|
@@ -21,7 +20,7 @@ describe HammerCLIForeman::Subnet do
|
|
21
20
|
end
|
22
21
|
|
23
22
|
context "output" do
|
24
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
23
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
25
24
|
|
26
25
|
it_should_print_n_records
|
27
26
|
it_should_print_columns ["Id", "Name", "Network", "Mask"]
|
@@ -45,7 +44,7 @@ describe HammerCLIForeman::Subnet do
|
|
45
44
|
it_should_print_n_records 1
|
46
45
|
it_should_print_columns ["Id", "Name", "Network", "Mask"]
|
47
46
|
it_should_print_columns ["Priority"]
|
48
|
-
it_should_print_columns ["DNS", "Primary DNS", "Secondary DNS"]
|
47
|
+
it_should_print_columns ["DNS", "DNS id", "Primary DNS", "Secondary DNS"]
|
49
48
|
it_should_print_columns ["Domain ids", "TFTP", "TFTP id", "DHCP", "DHCP id"]
|
50
49
|
it_should_print_columns ["vlan id", "Gateway", "From", "To"]
|
51
50
|
end
|
data/test/unit/template_test.rb
CHANGED
@@ -15,10 +15,6 @@ describe HammerCLIForeman::Template do
|
|
15
15
|
}
|
16
16
|
|
17
17
|
before :each do
|
18
|
-
resource_mock = ApipieResourceMock.new(cmd.class.resource.resource_class)
|
19
|
-
resource_mock.stub_method(:index, [])
|
20
|
-
resource_mock.stub_method(:show, template_hash)
|
21
|
-
cmd.class.resource resource_mock
|
22
18
|
cmd.stubs(:name_to_id).returns(1)
|
23
19
|
File.stubs(:read).returns("")
|
24
20
|
end
|
@@ -33,7 +29,7 @@ describe HammerCLIForeman::Template do
|
|
33
29
|
end
|
34
30
|
|
35
31
|
context "output" do
|
36
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
32
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
37
33
|
|
38
34
|
it_should_print_n_records
|
39
35
|
it_should_print_columns ["Id", "Name", "Type"]
|
@@ -44,7 +40,6 @@ describe HammerCLIForeman::Template do
|
|
44
40
|
:id => 1, :name => "PXE"
|
45
41
|
}
|
46
42
|
}
|
47
|
-
mock_resource_method(:index, [[template_wo_kind], nil])
|
48
43
|
cmd.run([]).must_equal 0
|
49
44
|
end
|
50
45
|
end
|
@@ -57,12 +52,32 @@ describe HammerCLIForeman::Template do
|
|
57
52
|
let(:cmd) { HammerCLIForeman::Template::InfoCommand.new("", ctx) }
|
58
53
|
|
59
54
|
context "parameters" do
|
55
|
+
before(:each) do
|
56
|
+
template = {
|
57
|
+
'config_template' => {
|
58
|
+
'id' => 1, 'name' => 'PXE', 'type' => 'something',
|
59
|
+
'operatingsystems' => [ { 'id' => 1 }, { 'id' => 3 }, { 'id' =>4 } ]
|
60
|
+
}
|
61
|
+
}
|
62
|
+
ResourceMocks.mock_action_call(:templates, :show, [template])
|
63
|
+
end
|
64
|
+
|
60
65
|
it_should_accept "id", ["--id=1"]
|
61
66
|
it_should_fail_with "no arguments"
|
62
67
|
end
|
63
68
|
|
64
69
|
context "output" do
|
65
70
|
with_params ["--id=1"] do
|
71
|
+
before(:each) do
|
72
|
+
template = {
|
73
|
+
'config_template' => {
|
74
|
+
'id' => 1, 'name' => 'PXE', 'type' => 'something',
|
75
|
+
'operatingsystems' => [ { 'id' => 1 }, { 'id' => 3 }, { 'id' =>4 } ]
|
76
|
+
}
|
77
|
+
}
|
78
|
+
ResourceMocks.mock_action_call(:templates, :show, [template])
|
79
|
+
end
|
80
|
+
|
66
81
|
it_should_print_n_records 1
|
67
82
|
it_should_print_columns ["Id", "Name", "Type", "OS ids"]
|
68
83
|
end
|
@@ -99,7 +114,7 @@ describe HammerCLIForeman::Template do
|
|
99
114
|
let(:cmd) { HammerCLIForeman::Template::CreateCommand.new("", ctx) }
|
100
115
|
|
101
116
|
before :each do
|
102
|
-
cmd.stubs(:
|
117
|
+
cmd.stubs(:option_template_kind_id).returns(1)
|
103
118
|
end
|
104
119
|
|
105
120
|
context "parameters" do
|
@@ -117,7 +132,7 @@ describe HammerCLIForeman::Template do
|
|
117
132
|
let(:cmd) { HammerCLIForeman::Template::UpdateCommand.new("", ctx) }
|
118
133
|
|
119
134
|
before :each do
|
120
|
-
cmd.stubs(:
|
135
|
+
cmd.stubs(:option_template_kind_id).returns(1)
|
121
136
|
end
|
122
137
|
|
123
138
|
context "parameters" do
|
data/test/unit/test_helper.rb
CHANGED
@@ -14,6 +14,16 @@ require 'minitest/spec'
|
|
14
14
|
require "minitest-spec-context"
|
15
15
|
require "mocha/setup"
|
16
16
|
|
17
|
+
|
18
|
+
require 'hammer_cli'
|
19
|
+
require 'hammer_cli_foreman/commands'
|
20
|
+
|
21
|
+
HammerCLIForeman.stubs(:resource_config).returns({
|
22
|
+
:apidoc_cache_dir => 'test/unit/data/' + (ENV['TEST_API_VERSION'] || '1.4'),
|
23
|
+
:apidoc_cache_name => 'foreman_api',
|
24
|
+
:dry_run => true})
|
25
|
+
|
26
|
+
|
17
27
|
require 'hammer_cli_foreman'
|
18
28
|
|
19
29
|
def ctx
|
@@ -30,3 +40,6 @@ require File.join(File.dirname(__FILE__), 'test_output_adapter')
|
|
30
40
|
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
|
31
41
|
require File.join(File.dirname(__FILE__), 'helpers/command')
|
32
42
|
require File.join(File.dirname(__FILE__), 'helpers/resource_disabled')
|
43
|
+
|
44
|
+
HammerCLI::Settings.load({:_params => {:interactive => false}})
|
45
|
+
|
@@ -13,7 +13,7 @@ class TestAdapter < HammerCLI::Output::Adapter::Abstract
|
|
13
13
|
puts @separator+fields.collect{|f| f.label.to_s}.join(@separator)+@separator
|
14
14
|
|
15
15
|
data.collect do |d|
|
16
|
-
puts @separator+fields.collect{ |f| f
|
16
|
+
puts @separator+fields.collect{ |f| data_for_field(f, d).to_s }.join(@separator)+@separator
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
data/test/unit/user_test.rb
CHANGED
@@ -7,7 +7,6 @@ describe HammerCLIForeman::User do
|
|
7
7
|
extend CommandTestHelper
|
8
8
|
|
9
9
|
before :each do
|
10
|
-
cmd.class.resource ApipieResourceMock.new(cmd.class.resource.resource_class)
|
11
10
|
cmd.stubs(:name_to_id).returns(1)
|
12
11
|
end
|
13
12
|
|
@@ -23,7 +22,7 @@ describe HammerCLIForeman::User do
|
|
23
22
|
end
|
24
23
|
|
25
24
|
context "output" do
|
26
|
-
let(:expected_record_count) { cmd.resource.call(:index)
|
25
|
+
let(:expected_record_count) { cmd.resource.call(:index).length }
|
27
26
|
|
28
27
|
it_should_print_n_records
|
29
28
|
it_should_print_columns ["Id", "Login", "Name", "Email"]
|
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.0
|
4
|
+
version: 0.1.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: 2014-
|
12
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hammer_cli
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.0
|
20
|
+
version: 0.1.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.0
|
27
|
+
version: 0.1.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: apipie-bindings
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '>='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
34
|
+
version: 0.0.6
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.
|
41
|
+
version: 0.0.6
|
42
42
|
description: |
|
43
43
|
Foreman commands for Hammer CLI
|
44
44
|
email: tstracho@redhat.com
|
@@ -49,6 +49,7 @@ extra_rdoc_files:
|
|
49
49
|
- README.md
|
50
50
|
files:
|
51
51
|
- lib/hammer_cli_foreman/report.rb
|
52
|
+
- lib/hammer_cli_foreman/i18n.rb
|
52
53
|
- lib/hammer_cli_foreman/media.rb
|
53
54
|
- lib/hammer_cli_foreman/domain.rb
|
54
55
|
- lib/hammer_cli_foreman/partition_table.rb
|
@@ -56,6 +57,7 @@ files:
|
|
56
57
|
- lib/hammer_cli_foreman/exceptions.rb
|
57
58
|
- lib/hammer_cli_foreman/smart_class_parameter.rb
|
58
59
|
- lib/hammer_cli_foreman/host.rb
|
60
|
+
- lib/hammer_cli_foreman/auth.rb
|
59
61
|
- lib/hammer_cli_foreman/hostgroup.rb
|
60
62
|
- lib/hammer_cli_foreman/organization.rb
|
61
63
|
- lib/hammer_cli_foreman/parameter.rb
|
@@ -70,6 +72,7 @@ files:
|
|
70
72
|
- lib/hammer_cli_foreman/output.rb
|
71
73
|
- lib/hammer_cli_foreman/compute_resource.rb
|
72
74
|
- lib/hammer_cli_foreman/common_parameter.rb
|
75
|
+
- lib/hammer_cli_foreman/credentials.rb
|
73
76
|
- lib/hammer_cli_foreman/commands.rb
|
74
77
|
- lib/hammer_cli_foreman/architecture.rb
|
75
78
|
- lib/hammer_cli_foreman/location.rb
|
@@ -330,6 +333,7 @@ files:
|
|
330
333
|
- test/unit/environment_test.rb
|
331
334
|
- test/unit/common_parameter_test.rb
|
332
335
|
- test/unit/report_test.rb
|
336
|
+
- test/unit/data/1.4/foreman_api.json
|
333
337
|
- test/unit/partition_table_test.rb
|
334
338
|
- test/unit/media_test.rb
|
335
339
|
- test/unit/exception_handler_test.rb
|
@@ -349,10 +353,14 @@ files:
|
|
349
353
|
- test/unit/hostgroup_test.rb
|
350
354
|
- test/unit/image_test.rb
|
351
355
|
- test/unit/output/formatters_test.rb
|
356
|
+
- test/unit/credentials_test.rb
|
352
357
|
- test/unit/user_test.rb
|
353
358
|
- test/unit/helpers/command.rb
|
354
359
|
- test/unit/helpers/resource_disabled.rb
|
355
360
|
- test/unit/architecture_test.rb
|
361
|
+
- locale/zanata.xml
|
362
|
+
- locale/hammer-cli-foreman.pot
|
363
|
+
- locale/Makefile
|
356
364
|
- README.md
|
357
365
|
homepage: http://github.com/theforeman/hammer-cli-foreman
|
358
366
|
licenses:
|
@@ -627,6 +635,7 @@ test_files:
|
|
627
635
|
- test/unit/environment_test.rb
|
628
636
|
- test/unit/common_parameter_test.rb
|
629
637
|
- test/unit/report_test.rb
|
638
|
+
- test/unit/data/1.4/foreman_api.json
|
630
639
|
- test/unit/partition_table_test.rb
|
631
640
|
- test/unit/media_test.rb
|
632
641
|
- test/unit/exception_handler_test.rb
|
@@ -646,6 +655,7 @@ test_files:
|
|
646
655
|
- test/unit/hostgroup_test.rb
|
647
656
|
- test/unit/image_test.rb
|
648
657
|
- test/unit/output/formatters_test.rb
|
658
|
+
- test/unit/credentials_test.rb
|
649
659
|
- test/unit/user_test.rb
|
650
660
|
- test/unit/helpers/command.rb
|
651
661
|
- test/unit/helpers/resource_disabled.rb
|