evilhornets 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hornet.rb +18 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c10bfd3c02ad6e2a2e9a733472153138070848d0
|
4
|
+
data.tar.gz: 66f5a60a21c35600d2805cfcaa6d68b902e38008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b1d2874b8531d0ab4522b8ffe76e9d5a1fce0cb42697f29eff01f5fffaf079917b5618c1e3dd9193ebf5e761454268e400df87f2852ee295940149516016aad
|
7
|
+
data.tar.gz: ae6ada4ebb63dd822023c9fdc498d82f2226a315a34744f667cc4bf10e54bb1d811faf7c7a195d2e6225f1cdd8382957ec882060d0ea568f6aa644d4f0cd2492
|
data/lib/hornet.rb
CHANGED
@@ -10,6 +10,17 @@ Commands = {
|
|
10
10
|
'report' => 'Report the load testing result.',
|
11
11
|
'help' => 'Print the help document.',
|
12
12
|
}
|
13
|
+
AMIs = {
|
14
|
+
'us-east-1' => 'ami-fbb35590',
|
15
|
+
'us-west-1' => 'ami-831cf4c7',
|
16
|
+
'us-west-2' => 'ami-318eb201',
|
17
|
+
'sa-east-1' => 'ami-9ba92886',
|
18
|
+
'eu-west-1' => 'ami-094f3f7e',
|
19
|
+
'eu-central-1' => 'ami-a67e47bb',
|
20
|
+
'ap-northeast-1' => 'ami-be73a2be',
|
21
|
+
'ap-southeast-1' => 'ami-2c19217e',
|
22
|
+
'ap-southeast-2' => 'ami-9b9de4a1'
|
23
|
+
}
|
13
24
|
|
14
25
|
class Hornet
|
15
26
|
|
@@ -101,7 +112,13 @@ class Hornet
|
|
101
112
|
raise ArgumentError.new 'Missing argument: --url'
|
102
113
|
end
|
103
114
|
when 'up'
|
104
|
-
ops = {:region => 'us-east-1', :username => 'ubuntu', :number => 1
|
115
|
+
ops = {:region => 'us-east-1', :username => 'ubuntu', :number => 1}.merge options.to_h
|
116
|
+
if not ops.has_key? :image_id
|
117
|
+
ops[:image_id] = AMIs[ops[:region]]
|
118
|
+
end
|
119
|
+
if not AMIs.keys.include? ops[:region]
|
120
|
+
raise ArgumentError.new 'Region must be in %s ' % AMIs.keys.join(', ')
|
121
|
+
end
|
105
122
|
if not ops.has_key? :key_name
|
106
123
|
raise ArgumentError.new 'Missing argument: --key'
|
107
124
|
end
|