Class: Chef::Handler::ConsulRelease
- Inherits:
-
Chef::Handler
- Object
- Chef::Handler
- Chef::Handler::ConsulRelease
- Defined in:
- lib/chef/handler/consul_release.rb
Instance Method Summary collapse
-
#initialize(host, session, key) ⇒ ConsulRelease
constructor
A new instance of ConsulRelease.
- #report ⇒ Object
Constructor Details
#initialize(host, session, key) ⇒ ConsulRelease
Returns a new instance of ConsulRelease.
24 25 26 27 28 |
# File 'lib/chef/handler/consul_release.rb', line 24 def initialize(host, session, key) @host = host @session = session @key = key end |
Instance Method Details
#report ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/chef/handler/consul_release.rb', line 30 def report Chef::Log.info "Removing Consul lock" Diplomat.configure do |config| config.url = 'http://' + @host + ':8500' end Diplomat::Lock.release(@key,@session) Diplomat::Session.destroy(@session) end |