Sha256: 050e2e2295864b4a6998a7e2d25141958f0a81badc65273ce46156b3bde57bb2
Contents?: true
Size: 1.26 KB
Versions: 9
Compression:
Stored size: 1.26 KB
Contents
module Actions module Foreman module Host class ImportFacts < Actions::EntryAction def resource_locks :import_facts end def plan(host_type, host_name, facts, certname, proxy_id) host = ::Host::Base.importHost(host_name, certname, proxy_id) action_subject(host, :facts => facts) plan_self end def run ::User.as :admin do host = ::Host.find(input[:host][:id]) state = host.import_facts(input[:facts]) output[:state] = state end rescue ::Foreman::Exception => e # This error is what is thrown by Host#ImportHostAndFacts when # the Host is in the build state. This can be refactored once # issue #3959 is fixed. raise e unless e.code == 'ERF51-9911' end def rescue_strategy ::Dynflow::Action::Rescue::Skip end def humanized_name _("Import facts") end def humanized_input input[:host] && input[:host][:name] end # default value for cleaning up the tasks, it can be overriden by settings def self.cleanup_after '30d' end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems