Module: ForemanRemoteExecution::SmartProxyExtensions

Defined in:
app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb

Instance Method Summary collapse

Instance Method Details

#pubkeyObject



3
4
5
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 3

def pubkey
  self[:pubkey] || update_pubkey
end

#refreshObject



14
15
16
17
18
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 14

def refresh
  errors = super
  update_pubkey
  errors
end

#update_pubkeyObject



7
8
9
10
11
12
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 7

def update_pubkey
  return unless has_feature?('SSH')
  key = ::ProxyAPI::RemoteExecutionSSH.new(:url => url).pubkey
  self.update_attribute(:pubkey, key) if key
  key
end