Class: ForemanRemoteExecutionCore::SuUserMethod
- Inherits:
-
Object
- Object
- ForemanRemoteExecutionCore::SuUserMethod
- Defined in:
- lib/foreman_remote_execution_core/script_runner.rb
Instance Attribute Summary collapse
-
#effective_user ⇒ Object
Returns the value of attribute effective_user.
-
#ssh_user ⇒ Object
Returns the value of attribute ssh_user.
Instance Method Summary collapse
- #cli_command_prefix ⇒ Object
- #filter_password?(received_data) ⇒ Boolean
-
#initialize(effective_user, ssh_user) ⇒ SuUserMethod
constructor
A new instance of SuUserMethod.
- #on_data(_, _) ⇒ Object
- #reset ⇒ Object
- #sent_all_data? ⇒ Boolean
Constructor Details
#initialize(effective_user, ssh_user) ⇒ SuUserMethod
Returns a new instance of SuUserMethod.
66 67 68 69 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 66 def initialize(effective_user, ssh_user) @effective_user = effective_user @ssh_user = ssh_user end |
Instance Attribute Details
#effective_user ⇒ Object
Returns the value of attribute effective_user.
64 65 66 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 64 def effective_user @effective_user end |
#ssh_user ⇒ Object
Returns the value of attribute ssh_user.
64 65 66 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 64 def ssh_user @ssh_user end |
Instance Method Details
#cli_command_prefix ⇒ Object
82 83 84 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 82 def cli_command_prefix "su - #{effective_user} -c " end |
#filter_password?(received_data) ⇒ Boolean
74 75 76 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 74 def filter_password?(received_data) false end |
#on_data(_, _) ⇒ Object
71 72 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 71 def on_data(_, _) end |
#reset ⇒ Object
86 87 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 86 def reset end |
#sent_all_data? ⇒ Boolean
78 79 80 |
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 78 def sent_all_data? true end |