capify-ec2 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md CHANGED
@@ -1,4 +1,10 @@
1
- ## 1.2.6 (May 16, 2012)
1
+ ## 1.2.9 (June 29, 2012)
2
+
3
+ Bugfixes:
4
+
5
+ - No longer throws an error when a server has no name.
6
+
7
+ ## 1.2.8 (May 16, 2012)
2
8
 
3
9
  Notes:
4
10
 
data/lib/capify-ec2.rb CHANGED
@@ -34,12 +34,12 @@ class CapifyEc2
34
34
  def determine_regions()
35
35
  @ec2_config[:aws_params][:regions] || [@ec2_config[:aws_params][:region]]
36
36
  end
37
-
37
+
38
38
  def display_instances
39
39
  desired_instances.each_with_index do |instance, i|
40
- puts sprintf "%-11s: %-40s %-20s %-20s %-62s %-20s (%s) (%s)",
41
- i.to_s.magenta, instance.name, instance.id.red, instance.flavor_id.cyan,
42
- instance.contact_point.blue, instance.availability_zone.green, (instance.tags["Roles"] || "").yellow,
40
+ puts sprintf "%02d: %-40s %-20s %-20s %-62s %-20s (%s) (%s)",
41
+ i, (instance.name || "").green, instance.id.red, instance.flavor_id.cyan,
42
+ instance.contact_point.blue, instance.availability_zone.magenta, (instance.tags["Roles"] || "").yellow,
43
43
  (instance.tags["Options"] || "").yellow
44
44
  end
45
45
  end
@@ -54,16 +54,18 @@ Capistrano::Configuration.instance(:must_exist).load do
54
54
 
55
55
  def ec2_roles(*roles)
56
56
  server_name = variables[:logger].instance_variable_get("@options")[:actions].first unless variables[:logger].instance_variable_get("@options")[:actions][1].nil?
57
- named_instance = capify_ec2.get_instance_by_name(server_name)
58
-
59
- task named_instance.name.to_sym do
60
- remove_default_roles
61
- server_address = named_instance.contact_point
62
- named_instance.roles.each do |role|
63
- define_role({:name => role, :options => {:on_no_matching_servers => :continue}}, named_instance)
64
- end
65
- end unless named_instance.nil?
66
57
 
58
+ if !server_name.nil?
59
+ named_instance = capify_ec2.get_instance_by_name(server_name)
60
+
61
+ task named_instance.name.to_sym do
62
+ remove_default_roles
63
+ server_address = named_instance.contact_point
64
+ named_instance.roles.each do |role|
65
+ define_role({:name => role, :options => {:on_no_matching_servers => :continue}}, named_instance)
66
+ end
67
+ end unless named_instance.nil?
68
+ end
67
69
  roles.each {|role| ec2_role(role)}
68
70
  end
69
71
 
@@ -1,5 +1,5 @@
1
1
  module Capify
2
2
  module Ec2
3
- VERSION = "1.2.8"
3
+ VERSION = "1.2.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capify-ec2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 8
10
- version: 1.2.8
9
+ - 9
10
+ version: 1.2.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Noah Cantor
@@ -16,8 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-05-16 00:00:00 +01:00
20
- default_executable:
19
+ date: 2012-06-29 00:00:00 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: fog
@@ -86,7 +85,6 @@ files:
86
85
  - lib/capify-ec2/server.rb
87
86
  - lib/capify-ec2/version.rb
88
87
  - readme.md
89
- has_rdoc: true
90
88
  homepage: http://github.com/forward/capify-ec2
91
89
  licenses: []
92
90
 
@@ -116,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
114
  requirements: []
117
115
 
118
116
  rubyforge_project: capify-ec2
119
- rubygems_version: 1.6.2
117
+ rubygems_version: 1.8.24
120
118
  signing_key:
121
119
  specification_version: 3
122
120
  summary: Grabs roles from ec2's tags and autogenerates capistrano tasks