instance_selector 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bf8913d19e961b3b2bf2483471ab2977ed3df19
4
- data.tar.gz: fc210a3b0dc754c62884127a3cdba34ca5c90397
3
+ metadata.gz: 9623a48c51d1a7fffa815c7432857ef84e2b6fce
4
+ data.tar.gz: 2afa2b4aebf772ae0c28ed392f0c55701eec19cd
5
5
  SHA512:
6
- metadata.gz: 8cb934239d57e47027dcd7d3fa4aaa478854892efcc7a570a6396bdc9ce87a2d658c9d0f6da0ff407a5428ba2b3f281276391a29d78724ffde7406f4ebb995e9
7
- data.tar.gz: 19533d33a80aac59de41403c4a854771db2b544667318e13b68a09e61b04a38283c557ecb08d143aaad829b4f5d6bdd12bf4e5d1c988b91b8da83a8516e79d51
6
+ metadata.gz: dbc76565667a69829f480081bde6460504be8758f0853f680c48441cf36ec7e17f735a41dba853a42baad217cae97d29287c4ee27b7f10b7e3180690bc58b432
7
+ data.tar.gz: cd59a0c2aa1712a7d63742f8145e710d4ec7864907650305a9d49ea23db3fa5a8b744a7d70a6a510553a52fcc84632038c8e3cf623dcf2834a157a5e11d78bff
@@ -8,16 +8,34 @@ opts = Slop.parse do
8
8
 
9
9
  on 'e=', 'environment=', "The environment servers are tagged with"
10
10
  on 'r=', 'role=', "The role servers are tagged with"
11
+ # on 't', 'tag-spots', "If the spot instances aren't tagged, update them"
12
+ on 'v', 'verbose', "Print more info about the instances"
11
13
  end
12
14
 
13
- if opts[:e] && opts[:r]
14
- filters = {}
15
- filters["tag:Role"] = opts[:r]
16
- filters["tag:Environment"] = opts[:e]
15
+ filters = {}
16
+ filters["tag:Role"] = opts[:r] if opts[:r]
17
+ filters["tag:Environment"] = opts[:e] if opts[:e]
17
18
 
18
- client = InstanceSelector::Connection.factory(:aws)
19
- instances = client.instances(filters)
20
- instances.each {|i| puts i[0]}
21
- else
19
+ unless opts[:e] || opts[:r]
22
20
  puts opts
21
+ exit 1
22
+ end
23
+
24
+ client = InstanceSelector::Connection.factory(:aws)
25
+ instances = client.instances(filters)
26
+
27
+ instances.each do |i|
28
+ print i[0]
29
+ print "\t" if (opts[:v] && (i[0].size+1) % 8 < 1)
30
+ print "\t" + i[1] if opts[:v]
31
+ print "\n"
32
+
33
+ # TODO: Convert instances to an object to associate more data with it, and move tagging to method in providers
34
+ # if opts[:t] && i[1].nil? && i[1] != ""
35
+ # tags = {}
36
+ # tags["Role"] = opts[:r] if opts[:r]
37
+ # tags["Environment"] = opts[:e] if opts[:e]
38
+ # tags["Name"] = "#{opts[:e]}-#{opts[:r]}"
39
+ # client.tag
40
+ # end
23
41
  end
@@ -1,3 +1,3 @@
1
1
  module InstanceSelector
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instance_selector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin McFadden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-18 00:00:00.000000000 Z
11
+ date: 2013-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog