Class: Bosh::Agent::ApplyPlan::Package
- Includes:
- Helpers
- Defined in:
- lib/bosh_agent/apply_plan/package.rb
Defined Under Namespace
Classes: InstallationError
Instance Attribute Summary collapse
-
#install_path ⇒ Object
readonly
Returns the value of attribute install_path.
-
#link_path ⇒ Object
readonly
Returns the value of attribute link_path.
Instance Method Summary collapse
-
#initialize(spec) ⇒ Package
constructor
A new instance of Package.
- #install_for_job(job) ⇒ Object
- #prepare_for_install ⇒ Object
Constructor Details
#initialize(spec) ⇒ Package
Returns a new instance of Package.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bosh_agent/apply_plan/package.rb', line 14 def initialize(spec) validate_spec(spec) @base_dir = Bosh::Agent::Config.base_dir @name = spec['name'] @version = spec['version'] @checksum = spec['sha1'] @blobstore_id = spec['blobstore_id'] @install_path = File.join(@base_dir, 'data', 'packages', @name, @version) @link_path = File.join(@base_dir, 'packages', @name) end |
Instance Attribute Details
#install_path ⇒ Object (readonly)
Returns the value of attribute install_path.
11 12 13 |
# File 'lib/bosh_agent/apply_plan/package.rb', line 11 def install_path @install_path end |
#link_path ⇒ Object (readonly)
Returns the value of attribute link_path.
12 13 14 |
# File 'lib/bosh_agent/apply_plan/package.rb', line 12 def link_path @link_path end |
Instance Method Details
#install_for_job(job) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/bosh_agent/apply_plan/package.rb', line 32 def install_for_job(job) fetch_bits_and_symlink create_symlink_in_job(job) if job rescue SystemCallError => e install_failed("System call error: #{e.}") end |
#prepare_for_install ⇒ Object
28 29 30 |
# File 'lib/bosh_agent/apply_plan/package.rb', line 28 def prepare_for_install fetch_bits end |