prometheus-splash 0.4.4 → 0.4.5

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
  SHA256:
3
- metadata.gz: 66529d2675de97b1938780ea84806295f26a826dd7e05fbe3132c6e125fa6934
4
- data.tar.gz: a137a6c2a50f06dc6ce9c03e23ab62e3268fdfc2d166ddcc494d30b33609e3db
3
+ metadata.gz: 7f4ea7ed10be999a00e43e04651616be5db143bbc0d85c11a1ca7126ad68aa33
4
+ data.tar.gz: dd66e18d9c1633033142b94852f3af61b066dd3dbc80de451f733b379e797203
5
5
  SHA512:
6
- metadata.gz: a91247f76572495354be94bb57a9d1c4d26f58eec91b5c28a0e244c3e3a66df2e987dc39031a6323c8e9eb16739f7f382614312cb89473da98f9e04a96e04f00
7
- data.tar.gz: 1472ea5a558e52ca43e8d893037a4b7f540920ac28e5fd9df156bad66540374cb8e61ef6166d37856ab59b4fa21c0e592ade34ef56013a15f48a920f43429add
6
+ metadata.gz: d923826528d62549cf890121e20474d13e5b88e1d8da3e8bf3136ef3232dd4a92b0bf11a6b4d07817786f192dc7e50e6f018d0611e544fafd906d7b7f8e9f79d
7
+ data.tar.gz: 3fec4f6263749824d308f1bbbeabf7dbd7ab5bef5f025ec921f0cef0f2ebd0b32584a117550091344b26dcf257cf0ed10fb7d6dbfd887ff8502468595d5ca578
@@ -55,4 +55,11 @@
55
55
 
56
56
  ### DOC :
57
57
 
58
- * prepare Vagrantfile and Ansible playbook
58
+ * prepare Vagrantfile and Ansible playbook
59
+
60
+
61
+ ## V 0.4.5 2020/04/17
62
+
63
+ ### FIX :
64
+
65
+ * RabbitMQ Exception catching + refacto connection #31
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  module Splash
3
3
  module Constants
4
- VERSION = "0.4.4"
4
+ VERSION = "0.4.5"
5
5
 
6
6
  # the path to th config file, not overridable by config
7
7
  CONFIG_FILE = "/etc/splash.yml"
@@ -11,17 +11,16 @@ module Splash
11
11
 
12
12
  def initialize(options = {})
13
13
  @config = get_config.transports
14
- @url = "amqp://"
14
+
15
15
  host = @config[:rabbitmq][:host]
16
16
  port = @config[:rabbitmq][:port]
17
- vhost = @config[:rabbitmq][:vhost]
18
- if @config[:rabbitmq][:user] and @config[:rabbitmq][:passwd] then
19
- creds = "#{@config[:rabbitmq][:user]}:#{@config[:rabbitmq][:passwd]}@"
20
- @url << creds
21
- end
22
- @url << "#{host}:#{port}#{vhost}"
17
+ vhost = (@config[:rabbitmq][:vhost])? @config[:rabbitmq][:vhost] : '/'
18
+ passwd = (@config[:rabbitmq][:passwd])? @config[:rabbitmq][:passwd] : 'guest'
19
+ user = (@config[:rabbitmq][:user])? @config[:rabbitmq][:user] : 'guest'
20
+ conf = { :host => host, :vhost => vhost, :user => user, :password => passwd, :port => port.to_i}
21
+
23
22
  begin
24
- @connection = Bunny.new @url
23
+ @connection = Bunny.new conf
25
24
  @connection.start
26
25
  @channel = @connection.create_channel
27
26
  @queue = @channel.queue options[:queue]
@@ -41,21 +40,19 @@ module Splash
41
40
 
42
41
  def initialize
43
42
  @config = get_config.transports
44
- @url = "amqp://"
45
43
  host = @config[:rabbitmq][:host]
46
44
  port = @config[:rabbitmq][:port]
47
- vhost = @config[:rabbitmq][:vhost]
48
- if @config[:rabbitmq][:user] and @config[:rabbitmq][:passwd] then
49
- creds = "#{@config[:rabbitmq][:user]}:#{@config[:rabbitmq][:passwd]}@"
50
- @url << creds
51
- end
52
- @url << "#{host}:#{port}#{vhost}"
45
+ vhost = (@config[:rabbitmq][:vhost])? @config[:rabbitmq][:vhost] : '/'
46
+ passwd = (@config[:rabbitmq][:passwd])? @config[:rabbitmq][:passwd] : 'guest'
47
+ user = (@config[:rabbitmq][:user])? @config[:rabbitmq][:user] : 'guest'
48
+ conf = { :host => host, :vhost => vhost, :user => user, :password => passwd, :port => port.to_i}
49
+
53
50
  begin
54
- @connection = Bunny.new @url
51
+ @connection = Bunny.new conf
55
52
  @connection.start
56
53
  @channel = @connection.create_channel
57
54
  rescue Bunny::Exception
58
- return { :case => :service_dependence_missing, :more => "RabbitMQ Transport not available." }
55
+ splash_exit case: :service_dependence_missing, more: "RabbitMQ Transport not available."
59
56
  end
60
57
  end
61
58
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-splash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain GEORGES