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
@@ -1,16 +1,16 @@
|
|
1
1
|
module HammerCLIForeman
|
2
2
|
|
3
|
-
class Model <
|
3
|
+
class Model < HammerCLIForeman::Command
|
4
4
|
|
5
|
-
resource
|
5
|
+
resource :models
|
6
6
|
|
7
7
|
class ListCommand < HammerCLIForeman::ListCommand
|
8
8
|
|
9
9
|
output do
|
10
|
-
field :id, "Id"
|
11
|
-
field :name, "Name"
|
12
|
-
field :vendor_class, "Vendor class"
|
13
|
-
field :hardware_model, "HW model"
|
10
|
+
field :id, _("Id")
|
11
|
+
field :name, _("Name")
|
12
|
+
field :vendor_class, _("Vendor class")
|
13
|
+
field :hardware_model, _("HW model")
|
14
14
|
end
|
15
15
|
|
16
16
|
apipie_options
|
@@ -20,9 +20,9 @@ module HammerCLIForeman
|
|
20
20
|
class InfoCommand < HammerCLIForeman::InfoCommand
|
21
21
|
|
22
22
|
output ListCommand.output_definition do
|
23
|
-
field :info, "Info"
|
24
|
-
field :created_at, "Created at", Fields::Date
|
25
|
-
field :updated_at, "Updated at", Fields::Date
|
23
|
+
field :info, _("Info")
|
24
|
+
field :created_at, _("Created at"), Fields::Date
|
25
|
+
field :updated_at, _("Updated at"), Fields::Date
|
26
26
|
end
|
27
27
|
|
28
28
|
apipie_options
|
@@ -30,23 +30,23 @@ module HammerCLIForeman
|
|
30
30
|
|
31
31
|
|
32
32
|
class CreateCommand < HammerCLIForeman::CreateCommand
|
33
|
-
success_message "Hardware model created"
|
34
|
-
failure_message "Could not create the hardware model"
|
33
|
+
success_message _("Hardware model created")
|
34
|
+
failure_message _("Could not create the hardware model")
|
35
35
|
|
36
36
|
apipie_options
|
37
37
|
end
|
38
38
|
|
39
39
|
class DeleteCommand < HammerCLIForeman::DeleteCommand
|
40
|
-
success_message "Hardware model deleted"
|
41
|
-
failure_message "Could not delete the hardware model"
|
40
|
+
success_message _("Hardware model deleted")
|
41
|
+
failure_message _("Could not delete the hardware model")
|
42
42
|
|
43
43
|
apipie_options
|
44
44
|
end
|
45
45
|
|
46
46
|
|
47
47
|
class UpdateCommand < HammerCLIForeman::UpdateCommand
|
48
|
-
success_message "Hardware model updated"
|
49
|
-
failure_message "Could not update the hardware model"
|
48
|
+
success_message _("Hardware model updated")
|
49
|
+
failure_message _("Could not update the hardware model")
|
50
50
|
|
51
51
|
apipie_options
|
52
52
|
end
|
@@ -57,5 +57,5 @@ module HammerCLIForeman
|
|
57
57
|
|
58
58
|
end
|
59
59
|
|
60
|
-
HammerCLI::MainCommand.subcommand 'model', "Manipulate hardware models.", HammerCLIForeman::Model
|
60
|
+
HammerCLI::MainCommand.subcommand 'model', _("Manipulate hardware models."), HammerCLIForeman::Model
|
61
61
|
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module HammerCLIForeman
|
2
2
|
|
3
|
-
class OperatingSystem <
|
3
|
+
class OperatingSystem < HammerCLIForeman::Command
|
4
4
|
|
5
|
-
resource
|
5
|
+
resource :operatingsystems
|
6
6
|
|
7
7
|
class ListCommand < HammerCLIForeman::ListCommand
|
8
8
|
|
9
9
|
output do
|
10
|
-
field :id, "Id"
|
11
|
-
field :_os_name, "Name", Fields::OSName
|
12
|
-
field :release_name, "Release name"
|
13
|
-
field :family, "Family"
|
10
|
+
field :id, _("Id")
|
11
|
+
field :_os_name, _("Name"), Fields::OSName
|
12
|
+
field :release_name, _("Release name")
|
13
|
+
field :family, _("Family")
|
14
14
|
end
|
15
15
|
|
16
16
|
def extend_data(os)
|
@@ -27,11 +27,11 @@ module HammerCLIForeman
|
|
27
27
|
identifiers :id
|
28
28
|
|
29
29
|
output ListCommand.output_definition do
|
30
|
-
field :media_names, "Installation media", Fields::List
|
31
|
-
field :architecture_names, "Architectures", Fields::List
|
32
|
-
field :ptable_names, "Partition tables", Fields::List
|
33
|
-
field :config_template_names, "Config templates", Fields::List
|
34
|
-
collection :parameters, "Parameters" do
|
30
|
+
field :media_names, _("Installation media"), Fields::List
|
31
|
+
field :architecture_names, _("Architectures"), Fields::List
|
32
|
+
field :ptable_names, _("Partition tables"), Fields::List
|
33
|
+
field :config_template_names, _("Config templates"), Fields::List
|
34
|
+
collection :parameters, _("Parameters") do
|
35
35
|
field nil, nil, Fields::KeyValue
|
36
36
|
end
|
37
37
|
end
|
@@ -39,10 +39,10 @@ module HammerCLIForeman
|
|
39
39
|
#FIXME: remove custom retrieve_data after the api has support for listing names
|
40
40
|
def extend_data(os)
|
41
41
|
os["_os_name"] = Hash[os.select { |k, v| ["name", "major", "minor"].include? k }]
|
42
|
-
os["media_names"] = os["media"].collect{|m| m["
|
43
|
-
os["architecture_names"] = os["architectures"].collect{|m| m["
|
44
|
-
os["ptable_names"] = os["ptables"].collect{|m| m["
|
45
|
-
os["config_template_names"] = os["config_templates"].collect{|m| m["
|
42
|
+
os["media_names"] = os["media"].collect{|m| m["name"] } rescue []
|
43
|
+
os["architecture_names"] = os["architectures"].collect{|m| m["name"] } rescue []
|
44
|
+
os["ptable_names"] = os["ptables"].collect{|m| m["name"] } rescue []
|
45
|
+
os["config_template_names"] = os["config_templates"].collect{|m| m["name"] } rescue []
|
46
46
|
os["parameters"] = HammerCLIForeman::Parameter.get_parameters(resource_config, :operatingsystem, os)
|
47
47
|
os
|
48
48
|
end
|
@@ -54,17 +54,17 @@ module HammerCLIForeman
|
|
54
54
|
class CreateCommand < HammerCLIForeman::CreateCommand
|
55
55
|
|
56
56
|
#FIXME: replace with apipie_options when they are added to the api docs
|
57
|
-
option "--architecture-ids", "ARCH_IDS", "set associated architectures",
|
57
|
+
option "--architecture-ids", "ARCH_IDS", _("set associated architectures"),
|
58
58
|
:format => HammerCLI::Options::Normalizers::List.new
|
59
|
-
option "--config-template-ids", "CONFIG_TPL_IDS", "set associated templates",
|
59
|
+
option "--config-template-ids", "CONFIG_TPL_IDS", _("set associated templates"),
|
60
60
|
:format => HammerCLI::Options::Normalizers::List.new
|
61
|
-
option "--medium-ids", "MEDIUM_IDS", "set associated installation media",
|
61
|
+
option "--medium-ids", "MEDIUM_IDS", _("set associated installation media"),
|
62
62
|
:format => HammerCLI::Options::Normalizers::List.new
|
63
|
-
option "--ptable-ids", "PTABLE_IDS", "set associated partition tables",
|
63
|
+
option "--ptable-ids", "PTABLE_IDS", _("set associated partition tables"),
|
64
64
|
:format => HammerCLI::Options::Normalizers::List.new
|
65
65
|
|
66
|
-
success_message "Operating system created"
|
67
|
-
failure_message "Could not create the operating system"
|
66
|
+
success_message _("Operating system created")
|
67
|
+
failure_message _("Could not create the operating system")
|
68
68
|
|
69
69
|
def request_params
|
70
70
|
params = method_options
|
@@ -82,19 +82,19 @@ module HammerCLIForeman
|
|
82
82
|
class UpdateCommand < HammerCLIForeman::UpdateCommand
|
83
83
|
|
84
84
|
#FIXME: replace with apipie_options when they are added to the api docs
|
85
|
-
option "--architecture-ids", "ARCH_IDS", "set associated architectures",
|
85
|
+
option "--architecture-ids", "ARCH_IDS", _("set associated architectures"),
|
86
86
|
:format => HammerCLI::Options::Normalizers::List.new
|
87
|
-
option "--config-template-ids", "CONFIG_TPL_IDS", "set associated templates",
|
87
|
+
option "--config-template-ids", "CONFIG_TPL_IDS", _("set associated templates"),
|
88
88
|
:format => HammerCLI::Options::Normalizers::List.new
|
89
|
-
option "--medium-ids", "MEDIUM_IDS", "set associated installation media",
|
89
|
+
option "--medium-ids", "MEDIUM_IDS", _("set associated installation media"),
|
90
90
|
:format => HammerCLI::Options::Normalizers::List.new
|
91
|
-
option "--ptable-ids", "PTABLE_IDS", "set associated partition tables",
|
91
|
+
option "--ptable-ids", "PTABLE_IDS", _("set associated partition tables"),
|
92
92
|
:format => HammerCLI::Options::Normalizers::List.new
|
93
93
|
|
94
94
|
identifiers :id
|
95
95
|
|
96
|
-
success_message "Operating system updated"
|
97
|
-
failure_message "Could not update the operating system"
|
96
|
+
success_message _("Operating system updated")
|
97
|
+
failure_message _("Could not update the operating system")
|
98
98
|
|
99
99
|
def request_params
|
100
100
|
params = method_options
|
@@ -113,24 +113,24 @@ module HammerCLIForeman
|
|
113
113
|
|
114
114
|
identifiers :id
|
115
115
|
|
116
|
-
success_message "Operating system deleted"
|
117
|
-
failure_message "Could not delete the operating system"
|
116
|
+
success_message _("Operating system deleted")
|
117
|
+
failure_message _("Could not delete the operating system")
|
118
118
|
|
119
119
|
apipie_options
|
120
120
|
end
|
121
121
|
|
122
122
|
class SetParameterCommand < HammerCLIForeman::Parameter::SetCommand
|
123
123
|
|
124
|
-
resource
|
124
|
+
resource :parameters
|
125
125
|
|
126
|
-
desc "Create or update parameter for an operating system."
|
126
|
+
desc _("Create or update parameter for an operating system.")
|
127
127
|
|
128
128
|
#FIXME: add option --os-label when api supports it
|
129
|
-
option "--os-id", "OS_ID", "id of the operating system the parameter is being set for"
|
129
|
+
option "--os-id", "OS_ID", _("id of the operating system the parameter is being set for")
|
130
130
|
|
131
|
-
success_message_for :update, "Operating system parameter updated"
|
132
|
-
success_message_for :create, "New operating system parameter created"
|
133
|
-
failure_message "Could not set operating system parameter"
|
131
|
+
success_message_for :update, _("Operating system parameter updated")
|
132
|
+
success_message_for :create, _("New operating system parameter created")
|
133
|
+
failure_message _("Could not set operating system parameter")
|
134
134
|
|
135
135
|
def validate_options
|
136
136
|
super
|
@@ -147,13 +147,13 @@ module HammerCLIForeman
|
|
147
147
|
|
148
148
|
class DeleteParameterCommand < HammerCLIForeman::Parameter::DeleteCommand
|
149
149
|
|
150
|
-
resource
|
150
|
+
resource :parameters
|
151
151
|
|
152
|
-
desc "Delete parameter for an operating system."
|
152
|
+
desc _("Delete parameter for an operating system.")
|
153
153
|
|
154
154
|
#FIXME: add option --os-label when api supports it
|
155
|
-
option "--os-id", "OS_ID", "id of the operating system the parameter is being deleted for"
|
156
|
-
success_message "operating system parameter deleted"
|
155
|
+
option "--os-id", "OS_ID", _("id of the operating system the parameter is being deleted for")
|
156
|
+
success_message _("operating system parameter deleted")
|
157
157
|
|
158
158
|
def validate_options
|
159
159
|
super
|
@@ -2,16 +2,16 @@ require 'hammer_cli_foreman/resource_supported_test'
|
|
2
2
|
|
3
3
|
module HammerCLIForeman
|
4
4
|
|
5
|
-
class Organization <
|
5
|
+
class Organization < HammerCLIForeman::Command
|
6
6
|
|
7
|
-
resource
|
7
|
+
resource :organizations
|
8
8
|
|
9
9
|
class ListCommand < HammerCLIForeman::ListCommand
|
10
10
|
include HammerCLIForeman::ResourceSupportedTest
|
11
11
|
|
12
12
|
output do
|
13
|
-
field :id, "Id"
|
14
|
-
field :name, "Name"
|
13
|
+
field :id, _("Id")
|
14
|
+
field :name, _("Name")
|
15
15
|
end
|
16
16
|
|
17
17
|
apipie_options
|
@@ -22,8 +22,8 @@ module HammerCLIForeman
|
|
22
22
|
include HammerCLIForeman::ResourceSupportedTest
|
23
23
|
|
24
24
|
output ListCommand.output_definition do
|
25
|
-
field :created_at, "Created at", Fields::Date
|
26
|
-
field :updated_at, "Updated at", Fields::Date
|
25
|
+
field :created_at, _("Created at"), Fields::Date
|
26
|
+
field :updated_at, _("Updated at"), Fields::Date
|
27
27
|
end
|
28
28
|
|
29
29
|
apipie_options
|
@@ -33,8 +33,8 @@ module HammerCLIForeman
|
|
33
33
|
class CreateCommand < HammerCLIForeman::CreateCommand
|
34
34
|
include HammerCLIForeman::ResourceSupportedTest
|
35
35
|
|
36
|
-
success_message "Organization created"
|
37
|
-
failure_message "Could not create the organization"
|
36
|
+
success_message _("Organization created")
|
37
|
+
failure_message _("Could not create the organization")
|
38
38
|
|
39
39
|
apipie_options
|
40
40
|
end
|
@@ -43,8 +43,8 @@ module HammerCLIForeman
|
|
43
43
|
class UpdateCommand < HammerCLIForeman::UpdateCommand
|
44
44
|
include HammerCLIForeman::ResourceSupportedTest
|
45
45
|
|
46
|
-
success_message "Organization updated"
|
47
|
-
failure_message "Could not update the organization"
|
46
|
+
success_message _("Organization updated")
|
47
|
+
failure_message _("Could not update the organization")
|
48
48
|
|
49
49
|
apipie_options
|
50
50
|
end
|
@@ -53,8 +53,8 @@ module HammerCLIForeman
|
|
53
53
|
class DeleteCommand < HammerCLIForeman::DeleteCommand
|
54
54
|
include HammerCLIForeman::ResourceSupportedTest
|
55
55
|
|
56
|
-
success_message "Organization deleted"
|
57
|
-
failure_message "Could not delete the organization"
|
56
|
+
success_message _("Organization deleted")
|
57
|
+
failure_message _("Could not delete the organization")
|
58
58
|
|
59
59
|
apipie_options
|
60
60
|
end
|
@@ -74,5 +74,5 @@ module HammerCLIForeman
|
|
74
74
|
|
75
75
|
end
|
76
76
|
|
77
|
-
HammerCLI::MainCommand.subcommand 'organization', "Manipulate organizations.", HammerCLIForeman::Organization
|
77
|
+
HammerCLI::MainCommand.subcommand 'organization', _("Manipulate organizations."), HammerCLIForeman::Organization
|
78
78
|
|
@@ -9,9 +9,14 @@ module HammerCLIForeman::Output
|
|
9
9
|
|
10
10
|
def format(os)
|
11
11
|
return nil if os.nil?
|
12
|
-
|
13
|
-
name
|
14
|
-
|
12
|
+
|
13
|
+
name = os['name'] || os[:name]
|
14
|
+
major = os['major'] || os[:major]
|
15
|
+
minor = os['minor'] || os[:minor]
|
16
|
+
|
17
|
+
formatted_name = "%s %s" % [name, major]
|
18
|
+
formatted_name += ".%s" % minor if (!minor.nil? && !minor.empty?)
|
19
|
+
formatted_name
|
15
20
|
end
|
16
21
|
end
|
17
22
|
|
@@ -22,7 +27,13 @@ module HammerCLIForeman::Output
|
|
22
27
|
end
|
23
28
|
|
24
29
|
def format(server)
|
25
|
-
|
30
|
+
if server.kind_of? Hash
|
31
|
+
name = server[:name] || server['name']
|
32
|
+
url = server[:url] || server['url']
|
33
|
+
"#{name} (#{url})"
|
34
|
+
else
|
35
|
+
server
|
36
|
+
end
|
26
37
|
end
|
27
38
|
end
|
28
39
|
|
@@ -9,23 +9,24 @@ module HammerCLIForeman
|
|
9
9
|
resource_type.to_s+"_id" => resource["id"] || resource["name"]
|
10
10
|
}
|
11
11
|
|
12
|
-
params =
|
12
|
+
params = HammerCLIForeman.foreman_resource(:parameters).call(:index, params)
|
13
13
|
HammerCLIForeman.collection_to_common_format(params)
|
14
14
|
end
|
15
15
|
|
16
|
-
class SetCommand <
|
16
|
+
class SetCommand < HammerCLIForeman::Command
|
17
17
|
|
18
18
|
include HammerCLI::Messages
|
19
|
+
include HammerCLIForeman::ConnectionSetup
|
19
20
|
|
20
|
-
option "--name", "NAME", "parameter name", :required => true
|
21
|
-
option "--value", "VALUE", "parameter value", :required => true
|
21
|
+
option "--name", "NAME", _("parameter name"), :required => true
|
22
|
+
option "--value", "VALUE", _("parameter value"), :required => true
|
22
23
|
|
23
24
|
def self.command_name(name=nil)
|
24
|
-
super(name) || "
|
25
|
+
(super(name) || "set-parameter").gsub('_', '-')
|
25
26
|
end
|
26
27
|
|
27
28
|
def self.resource(resource=nil)
|
28
|
-
super(resource) ||
|
29
|
+
super(resource) || HammerCLIForeman.foreman_resource(:parameters)
|
29
30
|
end
|
30
31
|
|
31
32
|
def execute
|
@@ -44,7 +45,7 @@ module HammerCLIForeman
|
|
44
45
|
end
|
45
46
|
|
46
47
|
def parameter_exist?
|
47
|
-
params = HammerCLIForeman.collection_to_common_format(resource.call(:index, base_action_params)
|
48
|
+
params = HammerCLIForeman.collection_to_common_format(resource.call(:index, base_action_params))
|
48
49
|
params.find { |p| p["name"] == option_name }
|
49
50
|
end
|
50
51
|
|
@@ -73,18 +74,19 @@ module HammerCLIForeman
|
|
73
74
|
end
|
74
75
|
|
75
76
|
|
76
|
-
class DeleteCommand <
|
77
|
+
class DeleteCommand < HammerCLIForeman::Command
|
77
78
|
|
78
79
|
include HammerCLI::Messages
|
80
|
+
include HammerCLIForeman::ConnectionSetup
|
79
81
|
|
80
|
-
option "--name", "NAME", "parameter name", :required => true
|
82
|
+
option "--name", "NAME", _("parameter name"), :required => true
|
81
83
|
|
82
84
|
def self.command_name(name=nil)
|
83
|
-
super(name) || "
|
85
|
+
(super(name) || "delete-parameter").gsub('_', '-')
|
84
86
|
end
|
85
87
|
|
86
88
|
def self.resource(resource=nil)
|
87
|
-
super(resource) ||
|
89
|
+
super(resource) || HammerCLIForeman.foreman_resource(:parameters)
|
88
90
|
end
|
89
91
|
|
90
92
|
def execute
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module HammerCLIForeman
|
2
2
|
|
3
|
-
class PartitionTable <
|
3
|
+
class PartitionTable < HammerCLIForeman::Command
|
4
4
|
|
5
|
-
resource
|
5
|
+
resource :ptables
|
6
6
|
|
7
7
|
class ListCommand < HammerCLIForeman::ListCommand
|
8
8
|
|
9
9
|
output do
|
10
|
-
field :id, "Id"
|
11
|
-
field :name, "Name"
|
12
|
-
field :os_family, "OS Family"
|
10
|
+
field :id, _("Id")
|
11
|
+
field :name, _("Name")
|
12
|
+
field :os_family, _("OS Family")
|
13
13
|
end
|
14
14
|
|
15
15
|
apipie_options
|
@@ -19,8 +19,8 @@ module HammerCLIForeman
|
|
19
19
|
class InfoCommand < HammerCLIForeman::InfoCommand
|
20
20
|
|
21
21
|
output ListCommand.output_definition do
|
22
|
-
field :created_at, "Created at", Fields::Date
|
23
|
-
field :updated_at, "Updated at", Fields::Date
|
22
|
+
field :created_at, _("Created at"), Fields::Date
|
23
|
+
field :updated_at, _("Updated at"), Fields::Date
|
24
24
|
end
|
25
25
|
|
26
26
|
apipie_options
|
@@ -30,7 +30,7 @@ module HammerCLIForeman
|
|
30
30
|
class DumpCommand < HammerCLIForeman::InfoCommand
|
31
31
|
|
32
32
|
command_name "dump"
|
33
|
-
desc "View partition table content."
|
33
|
+
desc _("View partition table content.")
|
34
34
|
|
35
35
|
def print_data(partition_table)
|
36
36
|
puts partition_table["layout"]
|
@@ -42,11 +42,11 @@ module HammerCLIForeman
|
|
42
42
|
|
43
43
|
class CreateCommand < HammerCLIForeman::CreateCommand
|
44
44
|
|
45
|
-
option "--file", "LAYOUT", "Path to a file that contains the partition layout", :attribute_name => :option_layout,
|
45
|
+
option "--file", "LAYOUT", _("Path to a file that contains the partition layout"), :attribute_name => :option_layout,
|
46
46
|
:required => true, :format => HammerCLI::Options::Normalizers::File.new
|
47
47
|
|
48
|
-
success_message "Partition table created"
|
49
|
-
failure_message "Could not create the partition table"
|
48
|
+
success_message _("Partition table created")
|
49
|
+
failure_message _("Could not create the partition table")
|
50
50
|
|
51
51
|
apipie_options :without => [:layout] + declared_identifiers.keys
|
52
52
|
end
|
@@ -54,19 +54,19 @@ module HammerCLIForeman
|
|
54
54
|
|
55
55
|
class UpdateCommand < HammerCLIForeman::UpdateCommand
|
56
56
|
|
57
|
-
option "--file", "LAYOUT", "Path to a file that contains the partition layout", :attribute_name => :option_layout,
|
57
|
+
option "--file", "LAYOUT", _("Path to a file that contains the partition layout"), :attribute_name => :option_layout,
|
58
58
|
:format => HammerCLI::Options::Normalizers::File.new
|
59
59
|
|
60
|
-
success_message "Partition table updated"
|
61
|
-
failure_message "Could not update the partition table"
|
60
|
+
success_message _("Partition table updated")
|
61
|
+
failure_message _("Could not update the partition table")
|
62
62
|
|
63
63
|
apipie_options :without => [:layout] + declared_identifiers.keys
|
64
64
|
end
|
65
65
|
|
66
66
|
|
67
67
|
class DeleteCommand < HammerCLIForeman::DeleteCommand
|
68
|
-
success_message "Partition table deleted"
|
69
|
-
failure_message "Could not delete the partition table"
|
68
|
+
success_message _("Partition table deleted")
|
69
|
+
failure_message _("Could not delete the partition table")
|
70
70
|
|
71
71
|
apipie_options
|
72
72
|
end
|
@@ -80,5 +80,4 @@ module HammerCLIForeman
|
|
80
80
|
|
81
81
|
end
|
82
82
|
|
83
|
-
HammerCLI::MainCommand.subcommand '
|
84
|
-
|
83
|
+
HammerCLI::MainCommand.subcommand 'partition-table', _("Manipulate partition tables."), HammerCLIForeman::PartitionTable
|