pl-puppetdb-ruby 2.0.2 → 2.0.3

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
- SHA1:
3
- metadata.gz: 75cced7d7b22d31de2105b1dd6d92d1c044f4c4f
4
- data.tar.gz: 9c53a504d40409c7816a050d8c05f5038560c794
2
+ SHA256:
3
+ metadata.gz: ededdeb26d38775d65bf3138883b529b2a9f18c62aa2eae05534431a066e05fe
4
+ data.tar.gz: 1cc1e91a547e8918bf5cd2fe63bdde5328435c4b0565acf75fb25c5f0e7cfbc7
5
5
  SHA512:
6
- metadata.gz: ef08c4aa79fc2cc2a1c044d008f6b38c4f01e4bbb99b78120e55a6077935b86ebe0d26b3d1dd5c8582497ac8cd3d0ca2f40ca334fe2cc7b062478ff55e79bdc9
7
- data.tar.gz: 17b50659d9fb6149c4802de705bedb83d38b63c702481a31994dc084109cde7e0d39648f12a6656a7dc2f7e3ae86a20a6d6b46c1fe6fe90250dae3b1d8f686e4
6
+ metadata.gz: 8a55abd3d564556d92ab4fb853207daf26fa6b4c18c9ceaed933f64e482689be761bc3f05c15bc8e253cbd49144166c7c5293de01abeee50dccde57bf0633462
7
+ data.tar.gz: aec5e7c3d2f79477610d8eada1e483a0fc995f51509808ac21a1b21c028c3f0ffe42ff8b6af29add88bcde0e7dda6407e2379c0c4d88b0f7dadd1945f5bb79f0
@@ -146,13 +146,11 @@ module PuppetDB
146
146
 
147
147
  def export(filename, opts = {})
148
148
  self.class.base_uri(@servers.first)
149
- path = "/pdb/admin/v#{@admin_api_version}/archive"
149
+ anonymization_profile = opts.delete(:anonymization_profile) || 'none'
150
+ path = "/pdb/admin/v#{@admin_api_version}/archive?anonymization_profile=#{anonymization_profile}"
150
151
 
151
- # Allow opts to override anonymization_profile, but enforce
152
- # stream_body to avoid using memory
153
- params = { anonymization_profile: 'none' }.
154
- merge(opts).
155
- merge(stream_body: true)
152
+ # Enforce stream_body to avoid using memory
153
+ params = opts.merge(stream_body: true)
156
154
 
157
155
  File.open(filename, 'w') do |file|
158
156
  self.class.get(path, params) do |fragment|
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'rbconfig'
2
3
 
3
4
  class PuppetDB::Config
4
5
  def initialize(overrides = nil, load_files = false)
@@ -8,12 +9,28 @@ class PuppetDB::Config
8
9
  @load_files = load_files
9
10
  end
10
11
 
12
+ def windows?
13
+ @is_windows ||= (RbConfig::CONFIG['host_os'] =~ %r{mswin|mingw|cygwin})
14
+ @is_windows
15
+ end
16
+
11
17
  def load_file(path)
12
- File.open(path) { |f| JSON.parse(f.read, symbolize_names: true)[:puppetdb] }
18
+ loaded_conf = File.open(path) { |f| JSON.parse(f.read, symbolize_names: true)[:puppetdb] }
19
+
20
+ # Munge token-file into token_file for better readability in Ruby
21
+ if loaded_conf[:'token-file']
22
+ loaded_conf[:token_file] = loaded_conf.delete(:'token-file')
23
+ end
24
+
25
+ loaded_conf
13
26
  end
14
27
 
15
28
  def puppetlabs_root
16
- '/etc/puppetlabs'
29
+ if windows?
30
+ 'C:\ProgramData\PuppetLabs'
31
+ else
32
+ '/etc/puppetlabs'
33
+ end
17
34
  end
18
35
 
19
36
  def global_conf
@@ -29,7 +46,7 @@ class PuppetDB::Config
29
46
  end
30
47
 
31
48
  def default_cacert
32
- "#{puppetlabs_root}/puppet/ssl/certs/ca.pem"
49
+ File.join(puppetlabs_root, 'puppet', 'ssl', 'certs', 'ca.pem')
33
50
  end
34
51
 
35
52
  def defaults
@@ -1,3 +1,3 @@
1
1
  module PuppetDB
2
- VERSION = '2.0.2'.freeze
2
+ VERSION = '2.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pl-puppetdb-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Blatt
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-04-29 00:00:00.000000000 Z
14
+ date: 2019-10-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httparty
@@ -129,7 +129,7 @@ files:
129
129
  - lib/puppetdb/version.rb
130
130
  homepage: https://github.com/austb/puppetdb-ruby
131
131
  licenses:
132
- - apache
132
+ - Apache-2.0
133
133
  metadata: {}
134
134
  post_install_message:
135
135
  rdoc_options: []
@@ -146,8 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubyforge_project:
150
- rubygems_version: 2.6.14.1
149
+ rubygems_version: 3.0.3
151
150
  signing_key:
152
151
  specification_version: 4
153
152
  summary: Simple Ruby client library for PuppetDB API