Class: ForemanRemoteExecutionCore::SuUserMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/foreman_remote_execution_core/script_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_userObject

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_userObject

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_prefixObject



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

Returns:

  • (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

#resetObject



86
87
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 86

def reset
end

#sent_all_data?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/foreman_remote_execution_core/script_runner.rb', line 78

def sent_all_data?
  true
end