oneops-admin/lib/shared/cookbooks/artifact/providers/deploy.rb
# Loads the saved manifest.yaml file and generates a new, current manifest. The
# saved manifest is then parsed through looking for files that may have been deleted,
# added, or modified.
# 
# @return [Boolean]
Loads the saved manifest.yaml file and generates a new, current manifest. The
saved manifest is then parsed through looking for files that may have been deleted,
added, or modified.
Loads the saved manifest . yaml file and generates a new current manifest . The saved manifest is then parsed through looking for files that may have been deleted added or modified .
def has_manifest_changed?
    require 'active_support/core_ext/hash'
    if skip_manifest_check?
      Chef::Log.info "artifact_deploy[has_manifest_changed?] Skip Manifest Check attribute is true. Skipping manifest check."
      return false
    end
    Chef::Log.info "artifact_deploy[has_manifest_changed?] Loading manifest.yaml file from directory: #{release_path}"
    begin
      saved_manifest = YAML.load_file(::File.join(release_path, "manifest.yaml"))
    rescue Errno::ENOENT
      Chef::Log.warn "artifact_deploy[has_manifest_changed?] Cannot load manifest.yaml. It may have been deleted. Deploying."
      return true
    end
    current_manifest = generate_manifest(release_path)
    Chef::Log.info "artifact_deploy[has_manifest_changed?] Comparing saved manifest from #{release_path} with regenerated manifest from #{release_path}."
    differences = !saved_manifest.diff(current_manifest).empty?
    if differences
      Chef::Log.info "artifact_deploy[has_manifest_changed?] Saved manifest from #{release_path} differs from regenerated manifest. Deploying."
      return true
    else
      Chef::Log.info "artifact_deploy[has_manifest_changed?] Saved manifest from #{release_path} is the same as regenerated manifest. Not Deploying."
      return false
    end
  end
def has_manifest_changed? require 'active_support/core_ext/hash' if skip_manifest_check? Chef :: Log . info "artifact_deploy[has_manifest_changed?] Skip Manifest Check attribute is true. Skipping manifest check." return false end Chef :: Log . info "artifact_deploy[has_manifest_changed?] Loading manifest.yaml file from directory: #{release_path}" begin saved_manifest = YAML . load_file ( :: File . join ( release_path , "manifest.yaml" ) ) rescue Errno :: ENOENT Chef :: Log . warn "artifact_deploy[has_manifest_changed?] Cannot load manifest.yaml. It may have been deleted. Deploying." return true end current_manifest = generate_manifest ( release_path ) Chef :: Log . info "artifact_deploy[has_manifest_changed?] Comparing saved manifest from #{release_path} with regenerated manifest from #{release_path}." differences = ! saved_manifest . diff ( current_manifest ) . empty? if differences Chef :: Log . info "artifact_deploy[has_manifest_changed?] Saved manifest from #{release_path} differs from regenerated manifest. Deploying." return true else Chef :: Log . info "artifact_deploy[has_manifest_changed?] Saved manifest from #{release_path} is the same as regenerated manifest. Not Deploying." return false end end
Loads the saved manifest.yaml file and generates a new, current manifest.
Loads the saved manifest . yaml file and generates a new current manifest .
None
Boolean