kafo 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kafo might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41d1cfdf276c5f8cf9df36c124011b2b011b3369
4
- data.tar.gz: f8033005a3355378b9947be0070325cd2368dd3d
3
+ metadata.gz: dd5b4f2364153ba6690849b0cd08ebcd09b4eb89
4
+ data.tar.gz: 9ac5cbef686845a19bd1060f8b7df8c18bab47b6
5
5
  SHA512:
6
- metadata.gz: f747712db68b6b2eec04bac5b1e0af72eca6f5c0f38591e1d9111b7af50400ee9fa43ee1693525879e82f3391d92cfe4102887f0af151337b418f6d5d121d0f1
7
- data.tar.gz: 5e55307ec40c518a463d4c45533f6a1d1bc4cb957ec0632215b259377ca7c0c217f37bcf0e8f19ca3d7ffaefa516108b281c280c8e3eec35187257fa8e64693a
6
+ metadata.gz: b2c23fd7953c7d3efda843dede39af12180d529ad317e065ce297d7c1f9b9a21595cc4b95f1ce485e1d4e172e736372db2d02b5f2f9970da814299e600ff9108
7
+ data.tar.gz: 82e5bbf8b98c25017f5c1d075f2f7c5ebd3cc69387ddd2f5e20c52357c23cab20a992f57b9b23d7d2a5fa6021e1fffb9f446c609a3268743f99c27d038c1a5e8
@@ -24,9 +24,13 @@ module Kafo
24
24
  def initialize(file)
25
25
  @file = file
26
26
  raise ModuleName, "File not found #{file}, check you answer file" unless File.exists?(file)
27
- parser = Puppet::Parser::Parser.new('production')
28
- values = Puppet.settings.instance_variable_get('@values')
29
- values[:production][:confdir] ||= '/' # just some stubbing
27
+ Puppet.settings[:confdir] ||= '/' # just some stubbing
28
+ if Puppet::Node::Environment.respond_to?(:create)
29
+ env = Puppet::Node::Environment.create(:production, [], '')
30
+ else
31
+ env = Puppet::Node::Environment.new(:production)
32
+ end
33
+ parser = Puppet::Parser::Parser.new(env)
30
34
  parser.import(@file)
31
35
 
32
36
  # Find object corresponding to class defined in init.pp in list of hostclasses
@@ -39,6 +43,7 @@ module Kafo
39
43
  ast_type = ast_objects.last
40
44
  @object = ast_type.last if ast_type.last.file == file
41
45
  end
46
+ parser
42
47
  end
43
48
 
44
49
  # TODO - store parsed object type (Puppet::Parser::AST::Variable must be dumped later)
data/lib/kafo/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
- VERSION = "0.3.12"
3
+ VERSION = "0.3.13"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler