hammer_cli_foreman 0.13.1 → 0.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/release_notes.md +4 -0
- data/lib/hammer_cli_foreman/api/interactive_basic_auth.rb +4 -0
- data/lib/hammer_cli_foreman/api/session_authenticator_wrapper.rb +4 -0
- data/lib/hammer_cli_foreman/hosts/common_update_options.rb +5 -9
- data/lib/hammer_cli_foreman/option_sources/user_params.rb +3 -0
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/test/unit/api/interactive_basic_auth_test.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 299ecfde2e76d65fc4c7f1d5bdac72f5d51143b0
|
4
|
+
data.tar.gz: 9b103faecf764289ef13d92c5eed3b2d2080cca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e1c8af02919b59b4650ab43a2435af314b9c52371eb4c258015e2e06a61a0e3786d30a49fc54ca7e9b0738160c8a3f94d05b43d7077c84b76dd3d129bf57c49
|
7
|
+
data.tar.gz: 942d83cbaf1b5d836ac3fc1cdfb8f6a37b52ea8695d8dbc49dfacbf86725c148e3c4b48b308f98bc1940901cd7dc7c68414091bc0141f857bd977d36fd7d78a4
|
data/doc/release_notes.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
Release notes
|
2
2
|
=============
|
3
|
+
### 0.13.2 (2018-08-15)
|
4
|
+
* Stop overriding apipie help for host flags ([#24490](http://projects.theforeman.org/issues/24490))
|
5
|
+
* Hammer asks for user password though -p option provided ([#23996](http://projects.theforeman.org/issues/23996))
|
6
|
+
|
3
7
|
### 0.13.1 (2018-07-18)
|
4
8
|
* removed redundant info about OS from hostgroup ([#23722](http://projects.theforeman.org/issues/23722))
|
5
9
|
|
@@ -82,6 +82,10 @@ module HammerCLIForeman
|
|
82
82
|
@authenticator.user(ask) if @authenticator.respond_to?(:user)
|
83
83
|
end
|
84
84
|
|
85
|
+
def password(ask=nil)
|
86
|
+
@authenticator.password(ask) if @authenticator.respond_to?(:password)
|
87
|
+
end
|
88
|
+
|
85
89
|
def set_credentials(*args)
|
86
90
|
@authenticator.set_credentials(*args) if @authenticator.respond_to?(:set_credentials)
|
87
91
|
end
|
@@ -25,12 +25,6 @@ module HammerCLIForeman
|
|
25
25
|
bme_options = {}
|
26
26
|
bme_options[:default] = 'true' if base.action.to_sym == :create
|
27
27
|
|
28
|
-
bme_options[:format] = HammerCLI::Options::Normalizers::Bool.new
|
29
|
-
base.option "--managed", "MANAGED", " ", bme_options
|
30
|
-
bme_options[:format] = HammerCLI::Options::Normalizers::Bool.new
|
31
|
-
base.option "--build", "BUILD", " ", bme_options
|
32
|
-
bme_options[:format] = HammerCLI::Options::Normalizers::Bool.new
|
33
|
-
base.option "--enabled", "ENABLED", " ", bme_options
|
34
28
|
bme_options[:format] = HammerCLI::Options::Normalizers::Bool.new
|
35
29
|
base.option "--overwrite", "OVERWRITE", " ", bme_options
|
36
30
|
|
@@ -71,9 +65,11 @@ module HammerCLIForeman
|
|
71
65
|
puppetclass_ids = option_puppetclass_ids || puppet_class_ids(option_puppet_classes)
|
72
66
|
params['host']['puppetclass_ids'] = puppetclass_ids unless puppetclass_ids.nil?
|
73
67
|
|
74
|
-
|
75
|
-
|
76
|
-
|
68
|
+
if action == :create
|
69
|
+
params['host']['build'] = true if option_build.nil?
|
70
|
+
params['host']['managed'] = true if option_managed.nil?
|
71
|
+
params['host']['enabled'] = true if option_enabled.nil?
|
72
|
+
end
|
77
73
|
params['host']['overwrite'] = option_overwrite unless option_overwrite.nil?
|
78
74
|
|
79
75
|
params['host']['host_parameters_attributes'] = parameter_attributes
|
@@ -13,7 +13,10 @@ module HammerCLIForeman
|
|
13
13
|
|
14
14
|
if @command.action == :update
|
15
15
|
if result[option_name(:password)] || result[option_name(:ask_password)]
|
16
|
+
|
16
17
|
if current_logged_user["id"].to_s == result[option_name(:id)].to_s
|
18
|
+
curr_passwd = HammerCLIForeman.foreman_api_connection.authenticator.password(true)
|
19
|
+
result[option_name(:current_password)] = curr_passwd unless curr_passwd.nil?
|
17
20
|
unless result[option_name(:current_password)]
|
18
21
|
result[option_name(:current_password)] = ask_password(:current)
|
19
22
|
end
|
@@ -66,6 +66,20 @@ describe HammerCLIForeman::Api::InteractiveBasicAuth do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
describe '#password' do
|
70
|
+
it "returns nil when password wasn't provided" do
|
71
|
+
auth = HammerCLIForeman::Api::InteractiveBasicAuth.new(nil, nil)
|
72
|
+
|
73
|
+
assert_nil auth.password
|
74
|
+
end
|
75
|
+
|
76
|
+
it "returns the password" do
|
77
|
+
auth = HammerCLIForeman::Api::InteractiveBasicAuth.new(nil, 'testpswd')
|
78
|
+
|
79
|
+
assert_equal 'testpswd', auth.password
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
69
83
|
describe '#error' do
|
70
84
|
let(:auth) { HammerCLIForeman::Api::InteractiveBasicAuth.new(nil, nil) }
|
71
85
|
|
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.13.
|
4
|
+
version: 0.13.2
|
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: 2018-
|
12
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hammer_cli
|