Skip to content

Commit

Permalink
adds addresses and sugar
Browse files Browse the repository at this point in the history
  • Loading branch information
slagyr committed Oct 9, 2012
1 parent a2c7867 commit 50e33c7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion TODO.md
@@ -1,3 +1,2 @@
* rake servers:chef[meal_name]: confirm before proceeding (add force option to bypass)
* security groups: More thought required
* EBS snapshots: More thought required
2 changes: 1 addition & 1 deletion boucher.gemspec
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = "boucher"
s.version = "0.1.8"
s.version = "0.2.0"
s.authors = ["'Micah Micah'"]
s.email = ["'micah@8thlight.com'"]
s.homepage = "http://github.com/8thlight/boucher"
Expand Down
2 changes: 1 addition & 1 deletion lib/boucher/env.rb
Expand Up @@ -5,7 +5,7 @@ module Boucher
} unless defined?(Boucher::Config)

def self.env_name
ENV["BENV"] ? ENV["BENV"] : :dev
Boucher::Config[:env] || ENV["BENV"] || :dev
end

env_dir = File.expand_path("config/env")
Expand Down
14 changes: 13 additions & 1 deletion lib/boucher/servers.rb
Expand Up @@ -7,7 +7,7 @@ module Boucher
def self.print_server_table_header
puts
printf SERVER_TABLE_FORMAT, "ID", "Environment", "Meal", "Creator", "State", "Public IP", "Private IP", "Inst. Size"
puts ("-" * 120)
puts ("-" * 107)
end

def self.print_server(server)
Expand Down Expand Up @@ -134,4 +134,16 @@ def self.change_servers_state(servers, command, new_state)
puts
puts "The servers have been #{command}-ed."
end

def self.resolve_servers(id_or_meal)
if id_or_meal[0..1] == "i-"
puts "Retrieving server with id #{id_or_meal}..."
[Boucher::Servers.with_id(id_or_meal)]
else
puts "Searching for running #{id_or_meal} servers in #{Boucher.env_name} environment..."
servers = Boucher::Servers.search(:meal => id_or_meal, :env => Boucher.env_name, :state => "!terminated")
Boucher::print_servers(servers)
servers
end
end
end
12 changes: 0 additions & 12 deletions lib/boucher/util.rb
Expand Up @@ -6,16 +6,4 @@ def self.current_user
"unknown"
end

def resolve_servers(id_or_meal)
if id_or_meal[0..1] == "i-"
puts "Retrieving server with id #{id_or_meal}..."
[Boucher::Servers.with_id(id_or_meal)]
else
puts "Searching for running #{id_or_meal} servers in #{Boucher.env_name} environment..."
servers = Boucher::Servers.search(:meal => id_or_meal, :env => Boucher.env_name, :state => "!terminated")
Boucher::print_servers[servers]
servers
end
end

end

0 comments on commit 50e33c7

Please sign in to comment.