Class Chef::Checksum
In: lib/chef/checksum/storage/filesystem.rb
lib/chef/checksum.rb
Parent: Object

Chef::Checksum

Checksum for an individual file; e.g., used for sandbox/cookbook uploading to track which files the system already manages.

Methods

Classes and Modules

Class Chef::Checksum::Storage

Constants

DESIGN_DOCUMENT = { "version" => 1, "language" => "javascript", "views" => { "all" => { "map" => <<-EOJS function(doc) { if (doc.chef_type == "checksum") { emit(doc.checksum, doc); } } EOJS

Attributes

checksum  [RW] 
couchdb_id  [RW] 
couchdb_rev  [RW] 
create_time  [RW] 
original_committed_file_location  [R]  When a Checksum commits a sandboxed file to its final home in the checksum repo, this attribute will have the original on-disk path where the file was stored; it will be used if the commit is reverted to restore the sandbox to the pre-commit state.
storage  [R] 

Public Class methods

Creates a new Chef::Checksum object.

Arguments

checksum::the MD5 content hash of the file
couchdb::An instance of Chef::CouchDB

Returns

object<Chef::Checksum>:Duh. :)

Public Instance methods

Moves the given sandbox_file into the checksum repo using the path given by file_location and saves the Checksum to the database

Removes the on-disk file backing this checksum object, then removes it from the database

Moves the checksum file back to its pre-commit location and deletes the checksum object from the database, effectively undoing commit_sandbox_file. Raises Chef::Exceptions::IllegalChecksumRevert if the original file location is unknown, which is will be the case if commit_sandbox_file was not previously called

[Validate]