hammer_cli 3.10.0 → 3.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/installation_deb.md +15 -11
- data/doc/release_notes.md +10 -0
- data/lib/hammer_cli/modules.rb +1 -1
- data/lib/hammer_cli/utils.rb +3 -2
- data/lib/hammer_cli/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/cs_CZ/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/it/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/ka/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli.mo +0 -0
- data/test/unit/modules_test.rb +4 -5
- data/test/unit/options/normalizers_test.rb +43 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '03459f5b492392bd38648599988ac3dd88ef9ed540b3234d7eef0e1140d99cce'
|
4
|
+
data.tar.gz: '08b41fb045c47eba7838eca2216df4153c35bb690acdfb63ff59a3566acbc5fb'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 363bfe3e6fbd7bc14910e61672856393789d800ea5ffbfe1a9d4c9f3abc003701c68f39d4282a97bd2732da800b4f48e6ff081e878f32b14e90656afe21aea7d
|
7
|
+
data.tar.gz: 4a55983e8ddaf65825875b0b115bd2994ccf5a7126e1a4ddc88a6270e0b4a985e5f0c688cbc907e1d6eadd07596362ad6799741c1a25cf35eecbcf53354a3da1
|
data/doc/installation_deb.md
CHANGED
@@ -2,26 +2,29 @@
|
|
2
2
|
|
3
3
|
#### Step 1: setup apt repositories
|
4
4
|
|
5
|
-
|
5
|
+
Since Foreman 1.3 the hammer packages are part of your installation repo.
|
6
|
+
It is only necessary to setup apt repositories if you are installing Hammer separatly from Foreman.
|
6
7
|
|
7
|
-
You can choose from
|
8
|
+
You can choose from a specific version or nightly repo.
|
9
|
+
Nightly has more recent version of hammer packages that have only had limited testing so there is a higher risk of issues.
|
8
10
|
|
9
|
-
|
11
|
+
Here are a few examples for combinations of Linux-distributions and Foreman releases.
|
12
|
+
Remember to adjust these as necessary, visit http://deb.theforeman.org/ for up to date information.
|
10
13
|
|
11
|
-
|
12
|
-
echo "deb http://deb.theforeman.org/ squeeze stable" > /etc/apt/sources.list.d/foreman.list
|
13
|
-
```
|
14
|
-
|
15
|
-
or nightly
|
14
|
+
##### Ubuntu Focal (20.04) with Foreman 3.10
|
16
15
|
|
17
16
|
```bash
|
18
|
-
|
17
|
+
mkdir -p /etc/apt/keyrings
|
18
|
+
wget -qO- https://deb.theforeman.org/foreman.asc > /etc/apt/keyrings/foreman.asc
|
19
|
+
echo "deb [signed-by=/etc/apt/keyrings/foreman.asc] http://deb.theforeman.org/ focal 3.10" > /etc/apt/sources.list.d/foreman.list
|
19
20
|
```
|
20
21
|
|
21
|
-
|
22
|
+
##### Debian Bullseye (11) with Foreman nightly
|
22
23
|
|
23
24
|
```bash
|
24
|
-
|
25
|
+
mkdir -p /etc/apt/keyrings
|
26
|
+
wget -qO- https://deb.theforeman.org/foreman.asc > /etc/apt/keyrings/foreman.asc
|
27
|
+
echo "deb [signed-by=/etc/apt/keyrings/foreman.asc] http://deb.theforeman.org/ bullseye nightly" > /etc/apt/sources.list.d/foreman.list
|
25
28
|
```
|
26
29
|
|
27
30
|
#### Step 2: install hammer core
|
@@ -46,3 +49,4 @@ $ apt-get install ruby-hammer-cli-katello
|
|
46
49
|
```
|
47
50
|
|
48
51
|
To install any other hammer plugin just make sure the appropriate gem is installed and follow with the [configuration](installation.md#configuration).
|
52
|
+
|
data/doc/release_notes.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
Release notes
|
2
2
|
=============
|
3
|
+
### 3.12.0 (2024-08-14)
|
4
|
+
* Log module loading warning to stderr ([PR #385](https://github.com/theforeman/hammer-cli/pull/385))
|
5
|
+
* Make clear_cache safe if no completion file is set ([PR #386](https://github.com/theforeman/hammer-cli/pull/386))
|
6
|
+
* Define correct timezone behavior in unittest, [#37579](http://projects.theforeman.org/issues/37579)
|
7
|
+
* Update deb install instructions ([PR #383](https://github.com/theforeman/hammer-cli/pull/383))
|
8
|
+
* Bump to 3.12.0-develop
|
9
|
+
|
10
|
+
### 3.11.0 (2024-05-22)
|
11
|
+
* Bump to 3.11.0-develop
|
12
|
+
|
3
13
|
### 3.10.0 (2024-02-21)
|
4
14
|
* Update packit ([PR #382](https://github.com/theforeman/hammer-cli/pull/382))
|
5
15
|
* Bump to 3.10.0-develop
|
data/lib/hammer_cli/modules.rb
CHANGED
@@ -54,7 +54,7 @@ module HammerCLI
|
|
54
54
|
require_module(name)
|
55
55
|
rescue Exception => e
|
56
56
|
logger.error "Error while loading module #{name}."
|
57
|
-
puts _("Warning: An error
|
57
|
+
$stderr.puts _("Warning: An error occurred while loading module %s.") % name
|
58
58
|
# with ModuleLoadingError we assume the error is already logged by the issuer
|
59
59
|
logger.error e unless e.is_a?(HammerCLI::ModuleLoadingError)
|
60
60
|
raise e
|
data/lib/hammer_cli/utils.rb
CHANGED
@@ -55,8 +55,9 @@ module HammerCLI
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def self.clear_cache
|
58
|
-
|
59
|
-
|
58
|
+
if (completion_file = HammerCLI::Settings.get(:completion_cache_file))
|
59
|
+
FileUtils.rm_f(File.expand_path(completion_file))
|
60
|
+
end
|
60
61
|
end
|
61
62
|
|
62
63
|
def self.interactive?
|
data/lib/hammer_cli/version.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/unit/modules_test.rb
CHANGED
@@ -128,26 +128,25 @@ describe HammerCLI::Modules do
|
|
128
128
|
before :each do
|
129
129
|
HammerCLI::Modules.stubs(:require_module).raises(RuntimeError)
|
130
130
|
@error_msg = "ERROR Modules : Error while loading module hammer_cli_tom."
|
131
|
-
@warning_msg = "Warning: An error
|
131
|
+
@warning_msg = "Warning: An error occurred while loading module hammer_cli_tom."
|
132
132
|
end
|
133
133
|
|
134
134
|
it "must log an error if the load! fails" do
|
135
|
-
|
135
|
+
assert_output("", "#{@warning_msg}\n") do
|
136
136
|
assert_raises(RuntimeError) { HammerCLI::Modules.load!('hammer_cli_tom') }
|
137
137
|
end
|
138
|
-
_(out).must_equal "#{@warning_msg}\n"
|
139
138
|
_(@log_output.readline.strip).must_equal @error_msg
|
140
139
|
end
|
141
140
|
|
142
141
|
it "must log an error if the load fails" do
|
143
|
-
assert_output("#{@warning_msg}\n"
|
142
|
+
assert_output("", "#{@warning_msg}\n") do
|
144
143
|
HammerCLI::Modules.load("hammer_cli_tom")
|
145
144
|
end
|
146
145
|
_(@log_output.readline.strip).must_equal @error_msg
|
147
146
|
end
|
148
147
|
|
149
148
|
it "must return false when load fails" do
|
150
|
-
assert_output("#{@warning_msg}\n"
|
149
|
+
assert_output("", "#{@warning_msg}\n") do
|
151
150
|
_(HammerCLI::Modules.load("hammer_cli_tom")).must_equal false
|
152
151
|
end
|
153
152
|
end
|
@@ -416,6 +416,16 @@ describe HammerCLI::Options::Normalizers do
|
|
416
416
|
|
417
417
|
end
|
418
418
|
|
419
|
+
def mock_env(partial_env_hash)
|
420
|
+
old_env = ENV.to_hash
|
421
|
+
ENV.update partial_env_hash
|
422
|
+
begin
|
423
|
+
yield
|
424
|
+
ensure
|
425
|
+
ENV.replace old_env
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
419
429
|
describe 'datetime' do
|
420
430
|
|
421
431
|
let(:formatter) { HammerCLI::Options::Normalizers::DateTime.new }
|
@@ -429,15 +439,45 @@ describe HammerCLI::Options::Normalizers do
|
|
429
439
|
end
|
430
440
|
|
431
441
|
it "should accept and parse iso8601" do
|
432
|
-
|
442
|
+
mock_env("TZ" => "UTC") do
|
443
|
+
_(formatter.format("1986-01-01T08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
|
444
|
+
end
|
433
445
|
end
|
434
446
|
|
435
447
|
it "should accept and parse YYYY-MM-DD HH:MM:SS" do
|
436
|
-
|
448
|
+
mock_env("TZ" => "UTC") do
|
449
|
+
_(formatter.format("1986-01-01 08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
|
450
|
+
end
|
437
451
|
end
|
438
452
|
|
439
453
|
it "should accept and parse YYYY/MM/DD HH:MM:SS" do
|
440
|
-
|
454
|
+
mock_env("TZ" => "UTC") do
|
455
|
+
_(formatter.format("1986/01/01 08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
|
456
|
+
end
|
457
|
+
end
|
458
|
+
|
459
|
+
it "should parse iso8601 compliant timezones" do
|
460
|
+
mock_env("TZ" => "UTC") do
|
461
|
+
_(formatter.format("1986-01-01 08:30:20 +04:00")).must_equal("1986-01-01T08:30:20+04:00")
|
462
|
+
end
|
463
|
+
end
|
464
|
+
|
465
|
+
it "should not parse non iso8601 formatted timezones" do
|
466
|
+
mock_env("TZ" => "Asia/Tokyo") do
|
467
|
+
_(formatter.format("1986-01-01 08:30:20 foo")).must_equal("1986-01-01T08:30:20+09:00")
|
468
|
+
end
|
469
|
+
end
|
470
|
+
|
471
|
+
it "should use system provided timezone" do
|
472
|
+
mock_env("TZ" => "Asia/Tokyo") do
|
473
|
+
_(formatter.format("1986-01-01 08:30:20")).must_equal("1986-01-01T08:30:20+09:00")
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
it "should overwrite default timezone" do
|
478
|
+
mock_env("TZ" => "Asia/Tokyo") do
|
479
|
+
_(formatter.format("1986-01-01 08:30:20 +04:00")).must_equal("1986-01-01T08:30:20+04:00")
|
480
|
+
end
|
441
481
|
end
|
442
482
|
|
443
483
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Bačovský
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-08-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: clamp
|
@@ -156,9 +156,9 @@ extra_rdoc_files:
|
|
156
156
|
- doc/option_builders.md
|
157
157
|
- doc/option_normalizers.md
|
158
158
|
- doc/output.md
|
159
|
+
- doc/release_notes.md
|
159
160
|
- doc/review_checklist.md
|
160
161
|
- doc/writing_a_plugin.md
|
161
|
-
- doc/release_notes.md
|
162
162
|
- config/cli.modules.d/module_config_template.yml
|
163
163
|
- config/cli_config.template.yml
|
164
164
|
- config/hammer.completion
|
@@ -384,7 +384,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
384
384
|
- !ruby/object:Gem::Version
|
385
385
|
version: '0'
|
386
386
|
requirements: []
|
387
|
-
rubygems_version: 3.
|
387
|
+
rubygems_version: 3.2.33
|
388
388
|
signing_key:
|
389
389
|
specification_version: 4
|
390
390
|
summary: Universal command-line interface
|