Method: Beaker::Subcommand#destroy

Defined in:
lib/beaker/subcommand.rb

#destroyObject



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/beaker/subcommand.rb', line 216

def destroy()
  if options[:help]
    invoke :help, [], ["destroy"]
    return
  end

  state = YAML::Store.new(SubcommandUtil::SUBCOMMAND_STATE)
  unless state.transaction { state['provisioned']}
    SubcommandUtil.error_with('Please provision an environment')
  end

  @cli.parse_options
  @cli.options[:provision] = false
  @cli.initialize_network_manager
  @cli.network_manager.cleanup

  state.transaction {
    state.delete('provisioned')
  }
end