File tree Expand file tree Collapse file tree
src/bosh-director/lib/bosh/director/deployment_plan Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -398,7 +398,21 @@ def packages_changed?
398398 end
399399
400400 def already_detached?
401- new? ? false : @existing_instance . detached?
401+ return false if new?
402+
403+ msg = "already_detached? checking: existing_instance.class=#{ existing_instance . class } , value=#{ existing_instance . inspect } "
404+ @logger . debug ( msg )
405+ $stderr. puts "[DEBUG] #{ msg } "
406+
407+ unless existing_instance . respond_to? ( :detached? )
408+ error_msg = "BUG: existing_instance does not respond to detached?! Class: #{ existing_instance . class } , Value: #{ existing_instance . inspect } "
409+ @logger . error ( error_msg )
410+ $stderr. puts "[ERROR] #{ error_msg } "
411+ # Fallback to string comparison for safety
412+ return existing_instance . is_a? ( String ) ? existing_instance == 'detached' : existing_instance . state == 'detached'
413+ end
414+
415+ existing_instance . detached?
402416 end
403417
404418 def needs_disk?
You can’t perform that action at this time.
0 commit comments