lib/services/connection.rb in jn_services-1.0.7 vs lib/services/connection.rb in jn_services-1.0.8
- old
+ new
@@ -48,13 +48,12 @@
# Validate args passeed in on initialize
#
# We require run_context OR host to function
#
def validate
- unless run_context || host
- fail ArgumentError, 'Must provide a run_context OR host to initialize'
- end
+ fail ArgumentError, 'Must provide a run_context OR host to initialize' unless
+ run_context || host
end
#
# Lazily Load the gem requirement so we can run inside chef
#
@@ -73,10 +72,10 @@
def find_servers
# need a run_context to find anything in
return nil unless run_context
# If there are already servers in attribs use those
return node[:etcd][:servers] if node.key?(:etcd) &&
- node[:etcd].key?(:servers)
+ node[:etcd].key?(:servers)
# if we have already searched in this run use those
return node.run_state[:etcd_servers] if node.run_state.key? :etcd_servers
# find nodes and build array of ip's