Sha256: 3eaf6e381ee58ea3d01e1ed40be5709498da2e9d214a974c9a061a5d955bcc31

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

module ForemanRemoteExecution
  module SmartProxyExtensions
    extend ActiveSupport::Concern

    included do
      alias_method_chain :refresh, :remote_execution
    end

    def pubkey
      self[:pubkey] || update_pubkey
    end

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

    def refresh_with_remote_execution
      errors = refresh_without_remote_execution
      update_pubkey
      errors
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_remote_execution-0.1.2 app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb
foreman_remote_execution-0.1.1 app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb
foreman_remote_execution-0.1.0 app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb