etcd-discovery 0.0.9 → 0.0.10

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: b113e0d1fc9ae5ffb0251f0beca030dae80cb27c
4
- data.tar.gz: a72656c507f6220cf70ca06a59f01b929614eb87
3
+ metadata.gz: 7089eb535dddfc946e32637321395451c748d86d
4
+ data.tar.gz: c8e76dedbe3dfb033b3e723f7c371d34dc62a481
5
5
  SHA512:
6
- metadata.gz: cb10c238f437eba20e3b011f2cfe3a9e9acaa05237cf70cecb6f26cc4ca84db4a82d2f48a8b7ca37f26dcd35ee57a583f5fff1bad2787ef9c7c5ae592624f95a
7
- data.tar.gz: 4761be1d7cc4fe0eddeb0984e41edf3590403a27a07f5c9654d840e6c7a2b4421e142645cf4431d884e24a31042eafcef2b282fa5542952a4f82ebc749821f0f
6
+ metadata.gz: 4f91a7f283f8a72238aa61134247a8106f5646762a3dc0dcfdb2055df72dbe7803fb814eeae0b7560d71764415d09fda6e408d22a0fdd6917cc7ef5a92ed6031
7
+ data.tar.gz: 17eed9d65421cf3a8f02c8cbbb56193cd31c293ee6f9a29fc6319e07b542b54b667c069a604413ebce901e959b522224baeaa4e7687563f5274a31bd48d20e7e
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'etcd'
4
4
  require 'json'
5
+ require 'logger'
5
6
 
6
7
  dir = File.join File.dirname(__FILE__), "etcd-discovery"
7
8
  Dir["#{dir}/*.rb"].each do |file|
@@ -24,6 +24,8 @@ module EtcdDiscovery
24
24
  end
25
25
 
26
26
  def self.register(service, host)
27
+ logger = Logger.new($stdout)
28
+
27
29
  if host.is_a? Hash
28
30
  h = Host.new host
29
31
  elsif host.is_a? Etcd::Host
@@ -41,7 +43,7 @@ module EtcdDiscovery
41
43
  begin
42
44
  client.set(key_name, value: value, ttl: config.register_ttl)
43
45
  rescue => e
44
- puts "Fail to set #{key_name}: #{e}, #{e.message}, #{e.class}"
46
+ logger.warn "Fail to set #{key_name}: #{e}, #{e.message}, #{e.class}"
45
47
  end
46
48
  sleep config.register_renew
47
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etcd-discovery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Unbekandt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: etcd