Class: Nvoi::Cli::Delete::Steps::DetachVolumes
- Inherits:
-
Object
- Object
- Nvoi::Cli::Delete::Steps::DetachVolumes
- Defined in:
- lib/nvoi/cli/delete/steps/detach_volumes.rb
Overview
DetachVolumes handles volume detachment before server deletion
Instance Method Summary collapse
-
#initialize(config, provider, log) ⇒ DetachVolumes
constructor
A new instance of DetachVolumes.
- #run ⇒ Object
Constructor Details
#initialize(config, provider, log) ⇒ DetachVolumes
Returns a new instance of DetachVolumes.
9 10 11 12 13 14 |
# File 'lib/nvoi/cli/delete/steps/detach_volumes.rb', line 9 def initialize(config, provider, log) @config = config @provider = provider @log = log @namer = config.namer end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/nvoi/cli/delete/steps/detach_volumes.rb', line 16 def run volume_configs = collect_volume_configs return if volume_configs.empty? @log.info "Detaching %d volume(s)", volume_configs.size volume_configs.each do |vol_config| detach_volume(vol_config) end end |