chef_handler_foreman 0.0.9 → 0.1.0

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: 3a662768086d4d4ce4be456b5062a0c104446499
4
- data.tar.gz: eb8cd1d3ef5c3fd26d731f82d3ee50ad3199c9e7
3
+ metadata.gz: 5b83750e2b938a42c0814f5c215e604eb2eb6652
4
+ data.tar.gz: 208020cc87c76471844899ba45eb6122bbe6868c
5
5
  SHA512:
6
- metadata.gz: fbd9c7fb1931bc7cfd9c5f7b6cd4edf17b278c471e8067248482e39b14c4b9fa045d519a037db4060caa61c1b1abdc878c902bc49fc8e2283e562f3712b0bb02
7
- data.tar.gz: b3af6bc4a822064115011e9b0d8987dac2ef2402a064d33dd0b7de10681d09a064a5f4670a2fa390cccdb43473679a13297a65313e3bc59d4e5ccfac34e861ae
6
+ metadata.gz: 2ca9c9999d841ab572885c7cb8ec776a73f4d257453dc431dd5eb50da8f9ffb98f667641728b7e3b7b5336e184807b8615798600d40cf59f3aa94ffe970506e8
7
+ data.tar.gz: 9307742f17cc892ecb02658f135b091818ab9227ae6bedb1cba28d08f7e355cab7f5dfb7587d274a47d43fa180a67ca74787cd8dd997fbf664b15b258fd877b3
@@ -30,8 +30,15 @@ module ChefHandlerForeman
30
30
  private
31
31
 
32
32
  def prepare_facts
33
- os = node.lsb[:id] || node.platform
34
- release = node.lsb[:release] || node.platform_version
33
+ return false if node.nil?
34
+
35
+ os, release = nil
36
+ if node.respond_to?(:lsb)
37
+ os = node.lsb[:id]
38
+ release = node.lsb[:release]
39
+ end
40
+ os ||= node.platform
41
+ release ||= node.platform_version
35
42
 
36
43
  # operatingsystem and operatingsystemrelase are not needed since foreman_chef 0.1.3
37
44
  { :name => node.name,
@@ -98,7 +105,9 @@ module ChefHandlerForeman
98
105
 
99
106
  def send_attributes(attributes)
100
107
  if @cache_file and !@cache_expired
101
- Chef::Log.info "No attributes have changed - not uploading to foreman"
108
+ Chef::Log.info "No attributes have changed - not uploading to foreman"
109
+ elsif !attributes
110
+ Chef::Log.info "No attributes received, failed run - not uploading to foreman"
102
111
  else
103
112
  if uploader
104
113
  Chef::Log.info 'Sending attributes to foreman'
@@ -1,3 +1,3 @@
1
1
  module ChefHandlerForeman
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef_handler_foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-30 00:00:00.000000000 Z
11
+ date: 2015-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler