Chapter 09/circuit-oneops-1-master/components/cookbooks/panos/libraries/address_manager.rb
# reusable function to commit the changes to the firewall and check the status
# of the async job that is queued.
reusable function to commit the changes to the firewall and check the status
of the async job that is queued.
reusable function to commit the changes to the firewall and check the status of the async job that is queued .
def commit_and_check_status(device_groups)
    device_groups.each do |device_group|
      commit = CommitRequest.new(@url, @key)
      job = commit.commit_configs(device_group)
      if !job.nil?
        status = StatusRequest.new(@url, @key)
        until status.job_complete?(job) do
          Chef::Log.info("job, #{job.id} still in progress")
          sleep(5)
        end
        Chef::Log.info("Job, #{job.id} complete!")
      end
    end
  end
def commit_and_check_status ( device_groups ) device_groups . each do | device_group | commit = CommitRequest . new ( @url , @key ) job = commit . commit_configs ( device_group ) if ! job . nil? status = StatusRequest . new ( @url , @key ) until status . job_complete? ( job ) do Chef :: Log . info ( "job, #{job.id} still in progress" ) sleep ( 5 ) end Chef :: Log . info ( "Job, #{job.id} complete!" ) end end end
reusable function to commit the changes to the firewall and check the status
of the async job that is queued.
reusable function to commit the changes to the firewall and check the status of the async job that is queued .
# commit the changes on the firewall device # check status until complete # won't continue until the update is complete.
device_groups
<not_specific>