evilhornets 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hornet.rb +18 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2eb8b072d3546ff3b3252cec33ada70b49e7279
4
- data.tar.gz: d8cad9948b5b5affda0e054f1ef594b17dc0770c
3
+ metadata.gz: c10bfd3c02ad6e2a2e9a733472153138070848d0
4
+ data.tar.gz: 66f5a60a21c35600d2805cfcaa6d68b902e38008
5
5
  SHA512:
6
- metadata.gz: a8e5645179e857ab39824dcf742b81f75c9c4c67051a1ce6d027102ffaaab38ff983d9644ad9b73e990b8683715442a2426b1d99093e62b9e91a1d61c24b2973
7
- data.tar.gz: 18d0774defbaed47e8b39a4e542cf1f628be92537747bd11d793188d3c9b4151f3290244ad3ed5e15ba82c63eaa8657e8ba8d8cb1ab6a9ca6b7713a33528657a
6
+ metadata.gz: 9b1d2874b8531d0ab4522b8ffe76e9d5a1fce0cb42697f29eff01f5fffaf079917b5618c1e3dd9193ebf5e761454268e400df87f2852ee295940149516016aad
7
+ data.tar.gz: ae6ada4ebb63dd822023c9fdc498d82f2226a315a34744f667cc4bf10e54bb1d811faf7c7a195d2e6225f1cdd8382957ec882060d0ea568f6aa644d4f0cd2492
@@ -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, :image_id => 'ami-c3e997f9'}.merge options.to_h
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evilhornets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Zhang