hugo 0.3.2 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hugo/app.rb +1 -1
- data/lib/hugo/aws/ec2.rb +21 -20
- data/lib/hugo/cloud.rb +4 -4
- metadata +2 -2
data/lib/hugo/app.rb
CHANGED
data/lib/hugo/aws/ec2.rb
CHANGED
@@ -40,10 +40,10 @@ module Hugo
|
|
40
40
|
@status = "unknown"
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
@security_group = options[:security_group] || "default"
|
44
|
+
if options["groupSet"] and options["groupSet"]["item"] and options["groupSet"]["item"][0]
|
45
|
+
@security_group = options["groupSet"]["item"][0]["groupId"]
|
46
|
+
end
|
47
47
|
|
48
48
|
end
|
49
49
|
|
@@ -52,7 +52,8 @@ module Hugo
|
|
52
52
|
@ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
|
53
53
|
result = @ec2.run_instances(:image_id => self.image_id, :key_name => self.key_name,
|
54
54
|
:max_count => 1,
|
55
|
-
:availability_zone => self.zone
|
55
|
+
:availability_zone => self.zone,
|
56
|
+
:security_group => self.security_group) unless self.create_time
|
56
57
|
set_attributes(result.instancesSet.item[0]) if result.instancesSet.item[0]
|
57
58
|
self
|
58
59
|
end
|
@@ -74,27 +75,27 @@ module Hugo
|
|
74
75
|
ssh.exec!("echo \"#{dna.to_json.gsub('"','\"')}\" > ~/dna.json")
|
75
76
|
end
|
76
77
|
commands.each do |cmd|
|
77
|
-
|
78
|
+
print ssh.exec!(cmd)
|
78
79
|
end
|
79
80
|
end
|
80
81
|
rescue
|
81
82
|
end
|
82
83
|
end
|
83
84
|
|
84
|
-
def self.find_or_create_security_group(name, description)
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
end
|
93
|
-
|
94
|
-
def self.destroy_security_group(name)
|
95
|
-
|
96
|
-
|
97
|
-
end
|
85
|
+
# def self.find_or_create_security_group(name, description)
|
86
|
+
# @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
|
87
|
+
# begin
|
88
|
+
# @security_groups = @ec2.describe_security_groups(:group_name => name)
|
89
|
+
# rescue
|
90
|
+
# @security_groups = @ec2.create_security_group(:group_name => name, :group_description => description)
|
91
|
+
# end
|
92
|
+
# @security_groups
|
93
|
+
# end
|
94
|
+
#
|
95
|
+
# def self.destroy_security_group(name)
|
96
|
+
# @ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
|
97
|
+
# @ec2.delete_security_group(:group_name => name)
|
98
|
+
# end
|
98
99
|
|
99
100
|
def self.all
|
100
101
|
@ec2 = AWS::EC2::Base.new(:access_key_id => ACCESS_KEY, :secret_access_key => SECRET_KEY)
|
data/lib/hugo/cloud.rb
CHANGED
@@ -60,10 +60,10 @@ class Hugo::Cloud
|
|
60
60
|
if db
|
61
61
|
puts <<REPORT
|
62
62
|
------------------------
|
63
|
-
DATABASE: #{db.
|
64
|
-
User: #{db.user}
|
65
|
-
Password: #{db.password}
|
66
|
-
Uri: #{db.uri}
|
63
|
+
DATABASE: #{db.info[:name]}
|
64
|
+
User: #{db.info[:user]}
|
65
|
+
Password: #{db.info[:password]}
|
66
|
+
Uri: #{db.info[:uri]}
|
67
67
|
REPORT
|
68
68
|
end
|
69
69
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hugo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Wilson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-02-
|
13
|
+
date: 2010-02-25 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|