puppetdb_foreman 0.1.2 → 0.1.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
2
  SHA1:
3
- metadata.gz: 8a81b111e883eae3b66330a375019b9f65227baa
4
- data.tar.gz: 3611a9e15096142d581d8c35eef162b23050d0d1
3
+ metadata.gz: 43c606bf582d08e8291a8b683cef9646123cef58
4
+ data.tar.gz: 56cecd8257e72267d52d04641f934d63573e236a
5
5
  SHA512:
6
- metadata.gz: ca1268d68b4d4fc521f4bd6cc79efdb2bb9a3e0823067a1ad50b8c52b6dfa2268a9dd968b729b82baf6b3614b03a5cdb865d8e612e63fd4ca579aed914e6e1dc
7
- data.tar.gz: 23f80d5b4ae21f6ecfc96630f7d36699d1ce5a11144347fe2f0e33ffab154a37fd1bbcad52bb71f6056fc0bab9f7bf96802283a878bd2cdf6f84cfc243508940
6
+ metadata.gz: 43b4d5fac5e312bacdab1719059b2391b689871fafe74e95fd55675c176fab1b8801067a3b893b2cd1e1ac54e3530691b2d2f029c934d50c16949e381ebf1e2f
7
+ data.tar.gz: 227b396f7c800b06c9a7a3085d8501fc1b611720b6dda5c78203a5965099d5ca963f2017c20ebee5bd3782b2e5b0ae989c55942a7bb7240ea107d362549b9260
@@ -7,9 +7,9 @@ module PuppetdbForeman
7
7
 
8
8
  def deactivate_host
9
9
  logger.debug "Deactivating host #{name} in Puppetdb"
10
- return false unless configured?
10
+ return false unless puppetdb_configured?
11
11
 
12
- if enabled?
12
+ if puppetdb_enabled?
13
13
  begin
14
14
  uri = URI.parse(Setting[:puppetdb_address])
15
15
  req = Net::HTTP::Post.new(uri.path)
@@ -39,14 +39,14 @@ module PuppetdbForeman
39
39
 
40
40
  private
41
41
 
42
- def configured?
43
- if enabled? && Setting[:puppetdb_address].blank?
42
+ def puppetdb_configured?
43
+ if puppetdb_enabled? && Setting[:puppetdb_address].blank?
44
44
  errors.add(:base, _("PuppetDB plugin is enabled but not configured. Please configure it before trying to delete a host."))
45
45
  end
46
46
  errors.empty?
47
47
  end
48
48
 
49
- def enabled?
49
+ def puppetdb_enabled?
50
50
  [true, 'true'].include? Setting[:puppetdb_enabled]
51
51
  end
52
52
  end
@@ -20,13 +20,7 @@ module PuppetdbForeman
20
20
  end
21
21
 
22
22
  config.to_prepare do
23
- if SETTINGS[:version].to_s.to_f >= 1.2
24
- # Foreman 1.2
25
- Host::Managed.send :include, PuppetdbForeman::HostExtensions
26
- else
27
- # Foreman < 1.2
28
- Host.send :include, PuppetdbForeman::HostExtensions
29
- end
23
+ Host::Managed.send :include, PuppetdbForeman::HostExtensions
30
24
  end
31
25
  end
32
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppetdb_foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-11 00:00:00.000000000 Z
11
+ date: 2015-10-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Disable hosts on PuppetDB after they are deleted or built in Foreman,
14
14
  and proxy the PuppetDB dashboard to Foreman. Follow https://github.com/theforeman/puppetdb_foreman
@@ -36,12 +36,12 @@ require_paths:
36
36
  - lib
37
37
  required_ruby_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  requirements: []
@@ -51,4 +51,3 @@ signing_key:
51
51
  specification_version: 4
52
52
  summary: This is a Foreman plugin to interact with PuppetDB.
53
53
  test_files: []
54
- has_rdoc: