foreman_remote_execution_core 1.1.2 → 1.1.3

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
- SHA256:
3
- metadata.gz: 6c119b8c10a5f1c10cd6862e38b3cd926c022887c897583677a9d3ecc2fa62fa
4
- data.tar.gz: 54295d5b48bfe55a17f32b9f599a23963f778a5d7ae3731e2a29001eae079528
2
+ SHA1:
3
+ metadata.gz: eca6ff4e60e56323032b2637ef2cb938e21ae852
4
+ data.tar.gz: 0b8b90235539506e27ff5d705b97900af87d6426
5
5
  SHA512:
6
- metadata.gz: 89101a702cc1be1ce3f471407659831c01dda578cc73c5d7c830a298eee15a0b390bc1f2f90d703328a6f054ec636f636b6bed3a2b5add49f73663a3cd2423c7
7
- data.tar.gz: eb23b63b87f06fd5cec7ddaff021669a34370a0972e3e63b7c6799b2a89cdbdc870e63e51a9edcc4d02c70d6806058c321dffa5b60fbd8d435fea99d555f9c2a
6
+ metadata.gz: 0624be3a51b26d2d684ef1b5c66dee5a5e2537928d5859abfd74902254a3a578690849207ffec222b70f5e285e3121fec2c23ba4594acc28fd086846cc1499b3
7
+ data.tar.gz: c2418362fbadf0ff698ce22fa77fdfad8aae09feada70e35cc9a5eb9cf4e12cab51a1162b0b6dd44a7794e78407685c5efa0947c16a35effa119ad370cda5060
@@ -21,12 +21,16 @@ module ForemanRemoteExecutionCore
21
21
  end
22
22
 
23
23
  def on_data(received_data, ssh_channel)
24
- if received_data.match(LOGIN_PROMPT)
24
+ if received_data.match(login_prompt)
25
25
  ssh_channel.send_data(effective_user_password + "\n")
26
26
  @password_sent = true
27
27
  end
28
28
  end
29
29
 
30
+ def login_prompt
31
+ LOGIN_PROMPT
32
+ end
33
+
30
34
  def filter_password?(received_data)
31
35
  !@effective_user_password.empty? && @password_sent && received_data.match(@effective_user_password)
32
36
  end
@@ -44,6 +48,18 @@ module ForemanRemoteExecutionCore
44
48
  end
45
49
  end
46
50
 
51
+ class DzdoUserMethod < SudoUserMethod
52
+ LOGIN_PROMPT = /password/i
53
+
54
+ def login_prompt
55
+ LOGIN_PROMPT
56
+ end
57
+
58
+ def cli_command_prefix
59
+ "dzdo -u #{effective_user} "
60
+ end
61
+ end
62
+
47
63
  class SuUserMethod
48
64
  attr_accessor :effective_user, :ssh_user
49
65
 
@@ -121,6 +137,9 @@ module ForemanRemoteExecutionCore
121
137
  elsif effective_user_method == 'sudo'
122
138
  SudoUserMethod.new(effective_user, ssh_user,
123
139
  options.fetch(:secrets, {}).fetch(:sudo_password, nil))
140
+ elsif effective_user_method == 'dzdo'
141
+ DzdoUserMethod.new(effective_user, ssh_user,
142
+ options.fetch(:secrets, {}).fetch(:sudo_password, nil))
124
143
  elsif effective_user_method == 'su'
125
144
  SuUserMethod.new(effective_user, ssh_user)
126
145
  else
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecutionCore
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2018-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks-core
@@ -56,7 +56,7 @@ files:
56
56
  - lib/foreman_remote_execution_core/version.rb
57
57
  homepage: https://github.com/theforeman/foreman_remote_execution
58
58
  licenses:
59
- - GPLv3
59
+ - GPL-3.0
60
60
  metadata: {}
61
61
  post_install_message:
62
62
  rdoc_options: []
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.7.3
77
+ rubygems_version: 2.6.12
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Foreman remote execution - core bits