Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Terminated machines are not bogus (fixes #165) #177

Merged
merged 2 commits into from

2 participants

@mrflip
Owner

The dead are not bogus (Bill & Ted I), they're ghosts (Bill & Ted II). This fixes #165.

  • terminated machines are skipped, as they were in old ironfan.
  • ...except in the case of knife cluster show, which accepts them as there-but-bogus if verbosity > 1.
Philip (flip... added some commits
Philip (flip) Kromer Terminated machines are not bogus
The dead are not bogus (Bill & Ted I), they're ghosts (Bill & Ted II)

* terminated machines are skipped, as they were in old ironfan.
* ...except in the case of knife cluster show, which accepts them as there-but-bogus if verbosity > 1.
35a680b
Philip (flip) Kromer Ignore deleting, deleted, or errored volumes in discovery 06d1f85
@temujin9

This doesn't actually display the terminated machines as advertised. I'll accept it anyway, and open a new low-priority bug: I prefer this failing to one that encourages --force.

@temujin9 temujin9 merged commit 06d1f85 into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 30, 2012
  1. Terminated machines are not bogus

    Philip (flip) Kromer authored
    The dead are not bogus (Bill & Ted I), they're ghosts (Bill & Ted II)
    
    * terminated machines are skipped, as they were in old ironfan.
    * ...except in the case of knife cluster show, which accepts them as there-but-bogus if verbosity > 1.
Commits on Oct 1, 2012
  1. Ignore deleting, deleted, or errored volumes in discovery

    Philip (flip) Kromer authored
This page is out of date. Refresh to see the latest.
View
1  lib/chef/knife/cluster_show.rb
@@ -35,6 +35,7 @@ class ClusterShow < Knife
:boolean => true
def run
+ with_verbosity(1){ config[:include_terminated] }
load_ironfan
die(banner) if @name_args.empty?
configure_dry_run
View
1  lib/ironfan/provider/ec2/ebs_volume.rb
@@ -52,6 +52,7 @@ def self.load!(cluster=nil)
Ironfan.substep(cluster.name, "volumes")
Ec2.connection.volumes.each do |vol|
next if vol.blank?
+ next if %w[deleting deleted error].include?(vol.state.to_s)
ebs = EbsVolume.new(:adaptee => vol)
# Already have a volume by this name
if recall? ebs.name
View
11 lib/ironfan/provider/ec2/machine.rb
@@ -105,15 +105,16 @@ def self.load!(cluster=nil)
Ironfan.substep(cluster.name, "machines")
Ec2.connection.servers.each do |fs|
machine = new(:adaptee => fs)
- if recall? machine.name
+ if (not machine.created?)
+ next unless Ironfan.chef_config[:include_terminated]
+ remember machine, :append_id => "terminated:#{machine.id}"
+ elsif recall? machine.name
raise 'duplicate'
machine.bogus << :duplicate_machines
recall(machine.name).bogus << :duplicate_machines
remember machine, :append_id => "duplicate:#{machine.id}"
- elsif machine.created?
+ else # never seen it
remember machine
- else
- remember machine, :append_id => "terminated:#{machine.id}"
end
Chef::Log.debug("Loaded #{machine}")
end
@@ -168,7 +169,7 @@ def self.create!(computer)
'name' => computer.name,
'Name' => computer.name,
}
- Ec2.ensure_tags(tags,computer.machine)
+ Ec2.ensure_tags(tags, computer.machine)
# register the new volumes for later save!, and tag appropriately
computer.machine.volumes.each do |v|
Something went wrong with that request. Please try again.