zonify 0.4.2.5 → 0.4.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/zonify.rb +1 -1
  2. data/lib/zonify/log.rb +36 -0
  3. metadata +5 -4
@@ -95,7 +95,7 @@ class AWS
95
95
  dns = i.dns_name
96
96
  # The default hostname for EC2 instances is derived from their internal
97
97
  # DNS entry.
98
- unless dns.nil? or dns.empty?
98
+ unless dns.nil? or dns.empty? or i.state == 'terminated'
99
99
  groups = (i.groups or [])
100
100
  attrs = { :sg => groups,
101
101
  :tags => (i.tags or []),
@@ -0,0 +1,36 @@
1
+ require 'time'
2
+
3
+ require 'sqlite3'
4
+
5
+ module Zonify
6
+ module Log
7
+
8
+ class SQLite
9
+ attr_reader :connection_string, :connection
10
+ def initialize(connection_string=':memory:')
11
+ @connection_string = connection_string
12
+ @connection = SQLite3::Database.new(@connection_string)
13
+ end
14
+
15
+ def log(record)
16
+ name, type, ttl, value,
17
+ weight, set = [ record[:name], record[:type],
18
+ record[:ttl], record[:value],
19
+ record[:weight], record[:set_identifier] ]
20
+ name, type, ttl, value,
21
+ weight, set = [ record[:name], record[:type],
22
+ record[:ttl], record[:value],
23
+ record[:weight], record[:set_identifier] ]
24
+ end
25
+ end
26
+
27
+ extend self
28
+
29
+ def now
30
+ x = Time.now.utc
31
+ x.iso8601.sub('T', ' ').sub('Z','.') + ("%0.3f" % x.to_f).split('.').last
32
+ end
33
+
34
+ end
35
+ end
36
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zonify
3
3
  version: !ruby/object:Gem::Version
4
- hash: 109
4
+ hash: 107
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 2
10
- - 5
11
- version: 0.4.2.5
10
+ - 6
11
+ version: 0.4.2.6
12
12
  platform: ruby
13
13
  authors:
14
14
  - Airbnb
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-01-30 00:00:00 Z
19
+ date: 2013-02-02 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: fog
@@ -45,6 +45,7 @@ extensions: []
45
45
  extra_rdoc_files: []
46
46
 
47
47
  files:
48
+ - lib/zonify/log.rb
48
49
  - lib/zonify.rb
49
50
  - README
50
51
  - bin/zonify