Class: Bosh::Director::CompiledPackage::CompiledPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/compiled_package/compiled_package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CompiledPackage

Returns a new instance of CompiledPackage.



11
12
13
14
15
16
17
18
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 11

def initialize(options = {})
  @package_name = options.fetch(:package_name)
  @package_fingerprint = options.fetch(:package_fingerprint)
  @sha1 = options.fetch(:sha1)
  @stemcell_sha1 = options.fetch(:stemcell_sha1)
  @blobstore_id = options.fetch(:blobstore_id)
  @blob_path = options.fetch(:blob_path)
end

Instance Attribute Details

#blob_pathObject (readonly)

Returns the value of attribute blob_path.



9
10
11
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 9

def blob_path
  @blob_path
end

#blobstore_idObject (readonly)

Returns the value of attribute blobstore_id.



9
10
11
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 9

def blobstore_id
  @blobstore_id
end

#package_fingerprintObject (readonly)

Returns the value of attribute package_fingerprint.



9
10
11
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 9

def package_fingerprint
  @package_fingerprint
end

#package_nameObject (readonly)

Returns the value of attribute package_name.



9
10
11
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 9

def package_name
  @package_name
end

#sha1Object (readonly)

Returns the value of attribute sha1.



9
10
11
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 9

def sha1
  @sha1
end

#stemcell_sha1Object (readonly)

Returns the value of attribute stemcell_sha1.



9
10
11
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 9

def stemcell_sha1
  @stemcell_sha1
end

Instance Method Details

#check_blob_shaObject



20
21
22
23
24
# File 'lib/bosh/director/compiled_package/compiled_package.rb', line 20

def check_blob_sha
  if sha1 != actual_sha
    raise BlobShaMismatchError, "Blob SHA mismatch in file #{blob_path}: expected: #{sha1}, got #{actual_sha}"
  end
end