abiquo-chef-agent 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -1,10 +1,11 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
+ require './lib/abiquo-chef-agent.rb'
3
4
 
4
5
  require 'jeweler'
5
6
  Jeweler::Tasks.new do |gem|
6
7
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
7
- gem.version = File.exist?('VERSION') ? File.read('VERSION') : ""
8
+ gem.version = Abiquo::Chef::VERSION
8
9
 
9
10
  gem.name = "abiquo-chef-agent"
10
11
  gem.homepage = "http://github.com/abiquo/abiquo-chef-agent"
@@ -27,7 +28,7 @@ task :default => :build
27
28
 
28
29
  require 'rdoc/task'
29
30
  Rake::RDocTask.new do |rdoc|
30
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
31
+ version = Abiquo::Chef::VERSION
31
32
 
32
33
  rdoc.rdoc_dir = 'rdoc'
33
34
  rdoc.title = "abiquo-chef-agent #{version}"
@@ -154,15 +154,19 @@ else
154
154
  log "Running chef-client first time"
155
155
  log cmd
156
156
  output = `#{cmd}`
157
+ #
158
+ # Remove validation certs and bootstrap XML
159
+ #
160
+ if File.exist?(Abiquo::Chef::Config.validation_cert)
161
+ FileUtils.rm(Abiquo::Chef::Config.validation_cert)
162
+ end
163
+ if File.exist?(Abiquo::Chef::Config.bootstrap_backup_file)
164
+ FileUtils.rm(Abiquo::Chef::Config.bootstrap_backup_file)
165
+ end
157
166
  if $? != 0
158
167
  log "chef-client run failed", :error
159
168
  log output, :debug
160
169
  else
161
- #
162
- # Remove validation certs and bootstrap XML
163
- #
164
- FileUtils.rm(Abiquo::Chef::Config.validation_cert)
165
- FileUtils.rm(Abiquo::Chef::Config.bootstrap_backup_file)
166
170
  log "Setting hostname"
167
171
  output = `hostname #{node_name} 2>&1`
168
172
  log output, :debug
@@ -3,7 +3,7 @@ require 'xmlsimple'
3
3
  module Abiquo
4
4
  module Chef
5
5
 
6
- VERSION="1.0.5"
6
+ VERSION="1.0.6"
7
7
 
8
8
  class Config
9
9
  def self.chef_config_dir
@@ -37,6 +37,11 @@ module Abiquo
37
37
  attr_reader :run_list, :node_name, :validation_client_name
38
38
  attr_reader :chef_server_url, :validation_cert
39
39
 
40
+ #
41
+ # Parses an XML chunk
42
+ #
43
+ # xml: the xml content
44
+ #
40
45
  def initialize(xml)
41
46
  @raw_xml = xml
42
47
  #
@@ -70,10 +75,7 @@ module Abiquo
70
75
  if not @chef_server_url or @chef_server_url.strip.chomp.empty?
71
76
  raise Exception.new("Invalid bootstrap XML. Missing <chef-server-url> info.")
72
77
  end
73
- @run_list = @node_info['runlist'].first['element']
74
- if not @run_list
75
- raise Exception.new("Invalid bootstrap XML. Missing <runlist>> info.")
76
- end
78
+ @run_list = @node_info['runlist'].first['element'] || []
77
79
  end
78
80
 
79
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abiquo-chef-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-09 00:00:00.000000000 Z
12
+ date: 2011-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: run-as-root
16
- requirement: &15727060 !ruby/object:Gem::Requirement
16
+ requirement: &20338440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15727060
24
+ version_requirements: *20338440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: chef
27
- requirement: &15726200 !ruby/object:Gem::Requirement
27
+ requirement: &20337840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *15726200
35
+ version_requirements: *20337840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: daemons
38
- requirement: &15725080 !ruby/object:Gem::Requirement
38
+ requirement: &20337240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *15725080
46
+ version_requirements: *20337240
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rest-client
49
- requirement: &15724260 !ruby/object:Gem::Requirement
49
+ requirement: &20336640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *15724260
57
+ version_requirements: *20336640
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: xml-simple
60
- requirement: &15748820 !ruby/object:Gem::Requirement
60
+ requirement: &20336020 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *15748820
68
+ version_requirements: *20336020
69
69
  description: Abiquo Chef Agent
70
70
  email: srubio@abiquo.com
71
71
  executables:
@@ -78,7 +78,6 @@ files:
78
78
  - LICENSE.txt
79
79
  - README.md
80
80
  - Rakefile
81
- - VERSION
82
81
  - bin/abiquo-chef-run
83
82
  - lib/abiquo-chef-agent.rb
84
83
  - scripts/abiquo-chef-agent.init
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.5