hammer_cli_foreman_resource_quota 0.1.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 187e58e0253c31ae050e968e2db0383c2b2a653a66e4c4891320ba8c69a83912
4
- data.tar.gz: 37b0ad55ea93acea85ce902bd59698431e3d1e90c4dc4b2d7602381e2e46f52f
3
+ metadata.gz: 4fe72ccb71ad90505dc4fb789f9f83d3f012a197793a61db25bbe1cf9a995899
4
+ data.tar.gz: fee04227dc069dd8d5c8a646a8a162f058bf2b08a5641209696e353ef0709781
5
5
  SHA512:
6
- metadata.gz: 876479005613a1ff47bd37a839a73e7135952910dac0cfebdf0238b0e00243e4a3b930fa4079e2b5aae102ff528275f50b0acf84dad1ff7d4bd1a5463490b5ee
7
- data.tar.gz: 3c9d60c8e8e32be9f123ef28253975bba69f110b79428b603daf3b6ee073f976e190636fe485668d293cd2e79b057bab4116ebdec6eaac187af6216141b11d88
6
+ metadata.gz: e6c1e26f29ecc072fc3f30f9014097ae2228a0d85f697e3785d6f970658b402057f8d4d2059ef30c8c1d279efe6c3cc0f1483ba0911d7d0d9a3c9057092174f0
7
+ data.tar.gz: 872dab16ed3bea502b486157766bdc910935e83e65aa4fd724fef76fd80ad855fd5ed271f1cbbc54d81257040357e963e916b79264fcf8d6025599d2a7e7bcf9
@@ -25,7 +25,11 @@ module HammerCLIForemanResourceQuota
25
25
  field :disk_gb, _('Disk space [GiB]')
26
26
  field :number_of_hosts, _('Assigned hosts')
27
27
  end
28
- build_options
28
+
29
+ build_options do |o|
30
+ o.without('location_id', 'organization_id')
31
+ o.expand.except(:locations, :organizations)
32
+ end
29
33
  end
30
34
 
31
35
  class InfoCommand < HammerCLIForeman::InfoCommand
@@ -41,37 +45,69 @@ module HammerCLIForemanResourceQuota
41
45
  end
42
46
  end
43
47
  end
44
- build_options
48
+
49
+ build_options do |o|
50
+ o.without('location_id', 'organization_id')
51
+ o.expand.except(:locations, :organizations)
52
+ end
45
53
  end
46
54
 
47
55
  class CreateCommand < HammerCLIForeman::CreateCommand
48
56
  success_message _('Resource quota created.')
49
57
  failure_message _('Could not create resource quota')
50
58
 
51
- option '--memory', "Memory", _('Maximum memory in MiB'), attribute_name: :memory_mb, format: HammerCLI::Options::Normalizers::Number.new
52
- option '--disk-space', "Disk space", _('Maximum disk space in GiB'), attribute_name: :disk_gb, format: HammerCLI::Options::Normalizers::Number.new
59
+ option '--memory', "Memory", _('Maximum memory in MiB'), attribute_name: :option_memory_mb, format: HammerCLI::Options::Normalizers::Number.new
60
+ option '--disk-space', "Disk space", _('Maximum disk space in GiB'), attribute_name: :option_disk_gb, format: HammerCLI::Options::Normalizers::Number.new
53
61
 
54
62
  build_options do |o|
55
- o.without('memory_mb', 'disk_gb')
63
+ o.expand.except(:locations, :organizations)
64
+ o.without('memory_mb', 'disk_gb', 'location_id', 'organization_id')
56
65
  end
57
66
  end
58
67
 
59
68
  class DeleteCommand < HammerCLIForeman::DeleteCommand
60
- success_message _('Resource quota [%{name}] was deleted.')
69
+ success_message _('Resource quota "%{name}" was deleted.')
61
70
  failure_message _('Could not delete the resource quota')
62
71
 
63
- build_options
72
+ build_options do |o|
73
+ o.without('location_id', 'organization_id')
74
+ o.expand.except(:locations, :organizations)
75
+ end
64
76
  end
65
77
 
66
78
  class UpdateCommand < HammerCLIForeman::UpdateCommand
67
- success_message _('Resource quota [%{name}] updated.')
79
+ success_message _('Resource quota "%{name}" updated.')
68
80
  failure_message _('Could not update the resource quota')
69
81
 
70
- option '--memory', "Memory", _('Maximum memory in MiB'), attribute_name: :memory_mb, format: HammerCLI::Options::Normalizers::Number.new
71
- option '--disk-space', "Disk space", _('Maximum disk space in GiB'), attribute_name: :disk_gb, format: HammerCLI::Options::Normalizers::Number.new
82
+ option '--memory', "Memory", _('Maximum memory in MiB'), attribute_name: :option_memory_mb, format: HammerCLI::Options::Normalizers::Number.new
83
+ option '--disk-space', "Disk space", _('Maximum disk space in GiB'), attribute_name: :option_disk_gb, format: HammerCLI::Options::Normalizers::Number.new
84
+ option '--remove-memory-limit', :flag, _('Remove quota limit for memory')
85
+ option '--remove-disk-space-limit', :flag, _('Remove quota limit for disk space')
86
+ option '--remove-cpu-cores-limit', :flag, _('Remove quota limit for CPU cores')
87
+
88
+ validate_options do
89
+ if option(:option_remove_memory_limit).exist? && option(:option_memory_mb).exist?
90
+ raise ArgumentError, _("You cannot set '--remove-memory-limit' and '--memory' options at the same time")
91
+ end
92
+ if option(:option_remove_disk_space_limit).exist? && option(:option_disk_gb).exist?
93
+ raise ArgumentError, _("You cannot set '--remove-disk-space-limit' and '--disk-space' options at the same time")
94
+ end
95
+ if option(:option_remove_cpu_cores_limit).exist? && option(:option_cpu_cores).exist?
96
+ raise ArgumentError, _("You cannot set '--remove-cpu-cores-limit' and '--cpu-cores' options at the same time")
97
+ end
98
+ end
99
+
100
+ def request_params
101
+ super.tap do |opts|
102
+ opts['resource_quota']['memory_mb'] = nil if option_remove_memory_limit?
103
+ opts['resource_quota']['disk_gb'] = nil if option_remove_disk_space_limit?
104
+ opts['resource_quota']['cpu_cores'] = nil if option_remove_cpu_cores_limit?
105
+ end
106
+ end
72
107
 
73
108
  build_options do |o|
74
- o.without('memory_mb', 'disk_gb')
109
+ o.without('memory_mb', 'disk_gb', 'location_id', 'organization_id')
110
+ o.expand.except(:locations, :organizations)
75
111
  end
76
112
  end
77
113
 
@@ -83,7 +119,10 @@ module HammerCLIForemanResourceQuota
83
119
  field :name, _('Host name')
84
120
  end
85
121
 
86
- build_options
122
+ build_options do |o|
123
+ o.without('location_id', 'organization_id')
124
+ o.expand.except(:locations, :organizations)
125
+ end
87
126
  end
88
127
 
89
128
  class ShowUsergroupsCommand < ShowCommand
@@ -94,7 +133,10 @@ module HammerCLIForemanResourceQuota
94
133
  field :name, _('Usergroup name')
95
134
  end
96
135
 
97
- build_options
136
+ build_options do |o|
137
+ o.without('location_id', 'organization_id')
138
+ o.expand.except(:locations, :organizations)
139
+ end
98
140
  end
99
141
 
100
142
  class ShowUsersCommand < ShowCommand
@@ -105,7 +147,10 @@ module HammerCLIForemanResourceQuota
105
147
  field :login, _('User name')
106
148
  end
107
149
 
108
- build_options
150
+ build_options do |o|
151
+ o.without('location_id', 'organization_id')
152
+ o.expand.except(:locations, :organizations)
153
+ end
109
154
  end
110
155
 
111
156
  class UnresolvedResourcesCommand < HammerCLIForeman::Command
@@ -116,7 +161,10 @@ module HammerCLIForemanResourceQuota
116
161
  field :missing_hosts, _('Missing hosts')
117
162
  end
118
163
 
119
- build_options
164
+ build_options do |o|
165
+ o.without('location_id', 'organization_id')
166
+ o.expand.except(:locations, :organizations)
167
+ end
120
168
  end
121
169
 
122
170
  autoload_subcommands
@@ -2,6 +2,6 @@
2
2
 
3
3
  module HammerCLIForemanResourceQuota
4
4
  def self.version
5
- @version ||= Gem::Version.new '0.1.0'
5
+ @version ||= Gem::Version.new '0.2.1'
6
6
  end
7
7
  end
@@ -3,13 +3,20 @@
3
3
  # This file is distributed under the same license as the hammer_cli_foreman_resource_quota package.
4
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
  #
6
+ # Translators:
7
+ # pdolinic, 2025
8
+ # mbacovsky <martin.bacovsky@gmail.com>, 2025
9
+ # Nadja Heitmann <nadjah@atix.de>, 2025
10
+ # Ettore Atalan <atalanttore@googlemail.com>, 2025
11
+ #
6
12
  #, fuzzy
7
13
  msgid ""
8
14
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_resource_quota 0.0.1\n"
15
+ "Project-Id-Version: hammer_cli_foreman_resource_quota 0.2.0\n"
10
16
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2023-07-12 14:40+0000\n"
17
+ "POT-Creation-Date: 2025-01-08 13:12+0000\n"
12
18
  "PO-Revision-Date: 2025-01-07 14:47+0000\n"
19
+ "Last-Translator: Ettore Atalan <atalanttore@googlemail.com>, 2025\n"
13
20
  "Language-Team: German (https://app.transifex.com/foreman/teams/114/de/)\n"
14
21
  "MIME-Version: 1.0\n"
15
22
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -21,16 +28,16 @@ msgid "Resource quota id"
21
28
  msgstr ""
22
29
 
23
30
  msgid "Id"
24
- msgstr ""
31
+ msgstr "ID"
25
32
 
26
33
  msgid "Name"
27
- msgstr ""
34
+ msgstr "Name"
28
35
 
29
36
  msgid "Created at"
30
- msgstr ""
37
+ msgstr "Erstellt am"
31
38
 
32
39
  msgid "CPU cores"
33
- msgstr ""
40
+ msgstr "CPU-Kerne"
34
41
 
35
42
  msgid "Memory [MiB]"
36
43
  msgstr ""
@@ -60,10 +67,10 @@ msgid "Could not create resource quota"
60
67
  msgstr ""
61
68
 
62
69
  msgid "Maximum memory in MiB"
63
- msgstr ""
70
+ msgstr "Maximaler Speicher in MiB"
64
71
 
65
72
  msgid "Maximum disk space in GiB"
66
- msgstr ""
73
+ msgstr "Maximaler Festplattenplatz in GiB"
67
74
 
68
75
  msgid "Resource quota [%{name}] was deleted."
69
76
  msgstr ""
@@ -1,22 +1,21 @@
1
- # English translations for hammer_cli_foreman_resource_quota package.
2
- # Copyright (C) 2025 THE PACKAGE'S COPYRIGHT HOLDER
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
3
  # This file is distributed under the same license as the hammer_cli_foreman_resource_quota package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
  #
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: hammer_cli_foreman_resource_quota 0.0.1\n"
8
+ "Project-Id-Version: hammer_cli_foreman_resource_quota 0.2.0\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "POT-Creation-Date: 2025-01-08 13:12+0000\n"
11
- "PO-Revision-Date: 2025-01-08 13:29+0000\n"
11
+ "PO-Revision-Date: 2025-01-08 13:12+0000\n"
12
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: English\n"
14
- "Language: en\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "Language: \n"
15
15
  "MIME-Version: 1.0\n"
16
16
  "Content-Type: text/plain; charset=UTF-8\n"
17
17
  "Content-Transfer-Encoding: 8bit\n"
18
- "Plural-Forms: nplurals=; plural=;\n"
19
- "\n"
18
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20
19
 
21
20
  msgid "Resource quota id"
22
21
  msgstr ""
@@ -3,13 +3,18 @@
3
3
  # This file is distributed under the same license as the hammer_cli_foreman_resource_quota package.
4
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
  #
6
+ # Translators:
7
+ # 0868a4d1af5275b3f70b0a6dac4c99a4, 2025
8
+ # Andi Chandler <andi@gowling.com>, 2025
9
+ #
6
10
  #, fuzzy
7
11
  msgid ""
8
12
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_resource_quota 0.0.1\n"
13
+ "Project-Id-Version: hammer_cli_foreman_resource_quota 0.2.0\n"
10
14
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2023-07-12 14:40+0000\n"
15
+ "POT-Creation-Date: 2025-01-08 13:12+0000\n"
12
16
  "PO-Revision-Date: 2025-01-07 14:47+0000\n"
17
+ "Last-Translator: Andi Chandler <andi@gowling.com>, 2025\n"
13
18
  "Language-Team: English (United Kingdom) (https://app.transifex.com/foreman/"
14
19
  "teams/114/en_GB/)\n"
15
20
  "MIME-Version: 1.0\n"
@@ -19,85 +24,85 @@ msgstr ""
19
24
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
25
 
21
26
  msgid "Resource quota id"
22
- msgstr ""
27
+ msgstr "Resource quota id"
23
28
 
24
29
  msgid "Id"
25
- msgstr ""
30
+ msgstr "Id"
26
31
 
27
32
  msgid "Name"
28
- msgstr ""
33
+ msgstr "Name"
29
34
 
30
35
  msgid "Created at"
31
- msgstr ""
36
+ msgstr "Created at"
32
37
 
33
38
  msgid "CPU cores"
34
- msgstr ""
39
+ msgstr "CPU cores"
35
40
 
36
41
  msgid "Memory [MiB]"
37
- msgstr ""
42
+ msgstr "Memory [MiB]"
38
43
 
39
44
  msgid "Disk space [GiB]"
40
- msgstr ""
45
+ msgstr "Disk space [GiB]"
41
46
 
42
47
  msgid "Assigned hosts"
43
- msgstr ""
48
+ msgstr "Assigned hosts"
44
49
 
45
50
  msgid "Number of users"
46
- msgstr ""
51
+ msgstr "Number of users"
47
52
 
48
53
  msgid "Number of usergroups"
49
- msgstr ""
54
+ msgstr "Number of usergroups"
50
55
 
51
56
  msgid "Number of missing hosts"
52
- msgstr ""
57
+ msgstr "Number of missing hosts"
53
58
 
54
59
  msgid "Utilization"
55
- msgstr ""
60
+ msgstr "Utilisation"
56
61
 
57
62
  msgid "Resource quota created."
58
- msgstr ""
63
+ msgstr "Resource quota created."
59
64
 
60
65
  msgid "Could not create resource quota"
61
- msgstr ""
66
+ msgstr "Could not create resource quota"
62
67
 
63
68
  msgid "Maximum memory in MiB"
64
- msgstr ""
69
+ msgstr "Maximum memory in MiB"
65
70
 
66
71
  msgid "Maximum disk space in GiB"
67
- msgstr ""
72
+ msgstr "Maximum disk space in GiB"
68
73
 
69
74
  msgid "Resource quota [%{name}] was deleted."
70
- msgstr ""
75
+ msgstr "Resource quota [%{name}] was deleted."
71
76
 
72
77
  msgid "Could not delete the resource quota"
73
- msgstr ""
78
+ msgstr "Could not delete the resource quota"
74
79
 
75
80
  msgid "Resource quota [%{name}] updated."
76
- msgstr ""
81
+ msgstr "Resource quota [%{name}] updated."
77
82
 
78
83
  msgid "Could not update the resource quota"
79
- msgstr ""
84
+ msgstr "Could not update the resource quota"
80
85
 
81
86
  msgid "Host name"
82
- msgstr ""
87
+ msgstr "Host name"
83
88
 
84
89
  msgid "Usergroup name"
85
- msgstr ""
90
+ msgstr "Usergroup name"
86
91
 
87
92
  msgid "User name"
88
- msgstr ""
93
+ msgstr "User name"
89
94
 
90
95
  msgid "Missing hosts"
91
- msgstr ""
96
+ msgstr "Missing hosts"
92
97
 
93
98
  msgid "Resource quota settings"
94
- msgstr ""
99
+ msgstr "Resource quota settings"
95
100
 
96
101
  msgid "Resource quota is optional"
97
- msgstr ""
102
+ msgstr "Resource quota is optional"
98
103
 
99
104
  msgid "Resource quota ids"
100
- msgstr ""
105
+ msgstr "Resource quota ids"
101
106
 
102
107
  msgid "Resource quota optional"
103
- msgstr ""
108
+ msgstr "Resource quota optional"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_resource_quota
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-01-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: hammer_cli_foreman
@@ -30,15 +29,14 @@ dependencies:
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: 0.3.0
32
+ version: '0.3'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: 0.3.0
41
- description:
39
+ version: '0.3'
42
40
  email:
43
41
  - info@atix.de
44
42
  executables: []
@@ -70,7 +68,6 @@ homepage: https://www.orcharhino.com/
70
68
  licenses:
71
69
  - GPL-3.0-only
72
70
  metadata: {}
73
- post_install_message:
74
71
  rdoc_options: []
75
72
  require_paths:
76
73
  - lib
@@ -88,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
85
  - !ruby/object:Gem::Version
89
86
  version: '0'
90
87
  requirements: []
91
- rubygems_version: 3.1.2
92
- signing_key:
88
+ rubygems_version: 4.0.3
93
89
  specification_version: 4
94
90
  summary: Foreman Resource Quota plugin for Hammer CLI
95
91
  test_files: []