hieracles 0.3.4 → 0.3.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b13932e02e3a94c2d72d12c3bb35a08cddc239c1
4
- data.tar.gz: f32c03c50537af5fa362e43e0eb1226c1c44bd4a
3
+ metadata.gz: fbed104b2e5efb9ab631dc6c92dbcdc15c12c93b
4
+ data.tar.gz: 23a3969b635a47856e7e4881b303db9de6080ecd
5
5
  SHA512:
6
- metadata.gz: efed20535c8925465eea69ee04e563b60ed889ebd618f01982c5d6e00734519dbeda24b9148e45cc760c845fc7e16ad345993db2f6ddfa977ac5b75669cd5300
7
- data.tar.gz: d9294d57191f85635277dc500a308972b169a806ac76d1994a942729c6b0307b9a6d1dff63530aef979f7c7b95b1135df6462ed03c2a78f9fd96f2cc6bce2685
6
+ metadata.gz: ef265813311aab75f57bc92bbe35cb2526969be6937741f909ea232a2d37bf7b7778e42d72bf255ed6e61afa9f0be6c90a9f02675c43b0578029442c75735273
7
+ data.tar.gz: 1c5d72ac972d07fd0e7751796b9be488ff39e91bc2789855d01d6caf96b356ddb50a5a4f3d3ddfb8a9b2b50644b33f2351485d54c957153c4eefe47dc2562cba
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Hieracles Changelog
2
2
  =======================
3
3
 
4
+ ### 0.3.5 - 2016-02-18
5
+ - change extraparams separator from ; to , to avoid having to quote argument
6
+ - fix merge order for extraparams to override configuration and puppetdb values
7
+
4
8
  ### 0.3.4 - 2016-02-12
5
9
  - add a farms_counted method to registry for a ponderated list of farms
6
10
 
data/README.md CHANGED
@@ -96,7 +96,7 @@ Usage
96
96
 
97
97
  Extra args:
98
98
  -f <plain|console|csv|yaml|rawyaml|json> - default console
99
- -p extraparam=what;anotherparam=this
99
+ -p extraparam=what,anotherparam=this
100
100
  -c <configfile>
101
101
  -h <hierafile>
102
102
  -b <basepath> default ./
data/hc.1 CHANGED
@@ -105,10 +105,10 @@ provenance of each params.
105
105
 
106
106
  .TP
107
107
  .PD 0
108
- .B \-p \fRextraparam=what;anotherparam=this
108
+ .B \-p \fRextraparam=what,anotherparam=this
109
109
  .TP
110
110
  .PD
111
- .B \-\-params \fRextraparam=what;anotherparam=this
111
+ .B \-\-params \fRextraparam=what,anotherparam=this
112
112
  makes possible to add additional params.
113
113
  Those params will be merged with the ones provided in the hierafile.
114
114
 
@@ -62,7 +62,7 @@ module Hieracles
62
62
  # str is like: something=xxx;another=yyy
63
63
  def extract_params(str)
64
64
  return {} unless str
65
- str.split(';').reduce({}) do |a, k|
65
+ str.split(',').reduce({}) do |a, k|
66
66
  a["#{k[/^[^=]*/]}".to_sym] = k[/[^=]*$/]
67
67
  a
68
68
  end
@@ -17,9 +17,10 @@ module Hieracles
17
17
  @hiera_params = { fqdn: @fqdn }.
18
18
  merge(get_hiera_params(@fqdn)).
19
19
  merge(@config.extraparams)
20
- @facts = deep_sort(@hiera_params.
21
- merge(@config.scope).
22
- merge(puppet_facts))
20
+ @facts = deep_sort(@config.scope.
21
+ merge(puppet_facts).
22
+ merge(@hiera_params)
23
+ )
23
24
  end
24
25
 
25
26
  def get_hiera_params(fqdn)
@@ -88,7 +88,7 @@ Available commands:
88
88
 
89
89
  Extra args:
90
90
  -f <plain|console|csv|yaml|rawyaml|json> default console
91
- -p extraparam=what;anotherparam=this
91
+ -p extraparam=what,anotherparam=this
92
92
  -c <configfile>
93
93
  -h <hierafile>
94
94
  -b <basepath> default ./
@@ -56,6 +56,10 @@ module Hieracles
56
56
  end
57
57
  alias_method :res, :resources
58
58
 
59
+ def events
60
+ @client.request("events")
61
+ end
62
+
59
63
  private
60
64
 
61
65
  def extract_names(resp, label = 'certname')
@@ -119,7 +119,7 @@ describe Hieracles::Config do
119
119
  config: 'spec/files/config.yml'
120
120
  }
121
121
  end
122
- let(:str) { 'bla=blu;one=two' }
122
+ let(:str) { 'bla=blu,one=two' }
123
123
  let(:expected) { { bla: 'blu', one: 'two' } }
124
124
  let(:config) { Hieracles::Config.new options }
125
125
  it { expect(config.extract_params(str)).to eq expected }
@@ -15,7 +15,7 @@ describe Hieracles::Node do
15
15
  context "when extra parameters are specified" do
16
16
  describe '.new' do
17
17
  let(:extraoptions) {
18
- options.merge({ params: 'key1=value1;key2=value2' })
18
+ options.merge({ params: 'key1=value1,key2=value2' })
19
19
  }
20
20
  let(:config) { Hieracles::Config.new extraoptions }
21
21
  let(:node) { Hieracles::Node.new 'server.example.com', config }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hieracles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - mose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-12 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty