Module: ForemanRemoteExecution::SmartProxyExtensions
- Defined in:
- app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb
Class Method Summary collapse
Instance Method Summary collapse
- #drop_host_from_known_hosts(host) ⇒ Object
- #pubkey ⇒ Object
- #refresh ⇒ Object
- #update_pubkey ⇒ Object
Class Method Details
.prepended(base) ⇒ Object
3 4 5 6 7 |
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 3 def self.prepended(base) base.instance_eval do has_many :host_proxy_invocations, :dependent => :destroy end end |
Instance Method Details
#drop_host_from_known_hosts(host) ⇒ Object
21 22 23 |
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 21 def drop_host_from_known_hosts(host) ::ProxyAPI::RemoteExecutionSSH.new(:url => url).drop_from_known_hosts(host) end |
#pubkey ⇒ Object
9 10 11 |
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 9 def pubkey self[:pubkey] || update_pubkey end |
#refresh ⇒ Object
25 26 27 28 29 |
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 25 def refresh errors = super update_pubkey errors end |
#update_pubkey ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb', line 13 def update_pubkey return unless has_feature?(%w(SSH Script)) key = ::ProxyAPI::RemoteExecutionSSH.new(:url => url).pubkey self.update_attribute(:pubkey, key) if key key end |