Class: Bosh::Director::VmMetadataUpdater
- Defined in:
- lib/bosh/director/vm_metadata_updater.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cloud, director_metadata, logger) ⇒ VmMetadataUpdater
constructor
A new instance of VmMetadataUpdater.
- #update(vm, metadata) ⇒ Object
Constructor Details
#initialize(cloud, director_metadata, logger) ⇒ VmMetadataUpdater
Returns a new instance of VmMetadataUpdater.
7 8 9 10 11 |
# File 'lib/bosh/director/vm_metadata_updater.rb', line 7 def initialize(cloud, , logger) @cloud = cloud @director_metadata = @logger = logger end |
Class Method Details
Instance Method Details
#update(vm, metadata) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bosh/director/vm_metadata_updater.rb', line 13 def update(vm, ) if @cloud.respond_to?(:set_vm_metadata) = .merge(@director_metadata) [:deployment] = vm.deployment.name if vm.instance [:job] = vm.instance.job [:index] = vm.instance.index.to_s end @cloud.(vm.cid, ) end rescue Bosh::Clouds::NotImplemented => e @logger.debug(e.inspect) end |