foreman_templates 4.0.1 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93bf3ba6264276231731d04135d565544b718db2
4
- data.tar.gz: dbc56dbd3b5b992dc9537c043eea071e61085140
3
+ metadata.gz: 405fd0e87a4cc0a5444b3bb95b0313df4618e607
4
+ data.tar.gz: 41e1005f524034615387b4640dc92d871d2b9ecf
5
5
  SHA512:
6
- metadata.gz: d1887e56355692e0edc5a4961237763a7dca030bc3326ef10874ed8e51541b9809add0ac9c340dae9ec5634fb5cbd0d8e8eb339fde42b86ef91a7b93827eed97
7
- data.tar.gz: d10d1091249e6ec67815f36903049c570c04fcfe109ba9520c2a173bc54667f6eaca8cd7027d1bceaa692fb959313b92b6d348a8071ce9f0b874ceb80c9528e3
6
+ metadata.gz: 4d9f281b4d709925c932f78a62e20de8729da61dec8f73501d0fbdb69b7ba25c6d08063481b016888f7d4cdb6f04e49e7c39fbfe4d7334abb5980a4d3817f80d
7
+ data.tar.gz: 6ba2b0f1bc1a70a9e40d32ef683ba27ddd780510e54a5a47458c13827d9c670c26c168093150e4d16d94e835ab065fcd7e686bd3e10887094b9ac93a82e63d9c
@@ -20,9 +20,10 @@ module ForemanTemplates::PtableImport
20
20
  id_string = ('id' + ptable.id) rescue ''
21
21
 
22
22
  if (metadata['associate'] == 'new' && ptable.new_record?) || (metadata['associate'] == 'always')
23
- data[:os_family] = oses.map(&:family).uniq.first
24
- data[:location_ids] = locations.map(&:id)
25
- data[:organization_ids] = organizations.map(&:id)
23
+ data[:operatingsystem_ids] = oses.map(&:id)
24
+ data[:os_family] = oses.map(&:family).uniq.first
25
+ data[:location_ids] = locations.map(&:id)
26
+ data[:organization_ids] = organizations.map(&:id)
26
27
  end
27
28
 
28
29
  if data[:layout] != ptable.layout
@@ -34,6 +35,7 @@ module ForemanTemplates::PtableImport
34
35
  status = ptable.update_attributes(data)
35
36
  result = " #{c_or_u} Ptable #{id_string}:#{name}"
36
37
  result += "\n Operatingsystem Family:\n - #{oses.map(&:family).uniq.first}" unless oses.empty?
38
+ result += "\n Operatingsystem Associations:\n - #{oses.map(&:fullname).join("\n - ")}" unless oses.empty?
37
39
  result += "\n Organizations Associations:\n - #{organizations.map(&:name).join("\n - ")}" unless organizations.empty?
38
40
  result += "\n Location Associations:\n - #{locations.map(&:name).join("\n - ")}" unless locations.empty?
39
41
  elsif data[:os_family] || data[:location_ids] || data[:organization_ids]
@@ -41,6 +43,7 @@ module ForemanTemplates::PtableImport
41
43
  status = ptable.update_attributes(data)
42
44
  result = " #{c_or_u} Ptable Associations #{id_string}:#{name}"
43
45
  result += "\n Operatingsystem Family:\n - #{oses.map(&:family).uniq.first}" unless oses.empty?
46
+ result += "\n Operatingsystem Associations:\n - #{oses.map(&:fullname).join("\n - ")}" unless oses.empty?
44
47
  result += "\n Organizations Associations:\n - #{organizations.map(&:name).join("\n - ")}" unless organizations.empty?
45
48
  result += "\n Location Associations:\n - #{locations.map(&:name).join("\n - ")}" unless locations.empty?
46
49
  else
@@ -34,7 +34,7 @@ module ForemanTemplates
34
34
  end
35
35
 
36
36
  def git_repo?
37
- @repo.start_with?('http://', 'https://', 'git://')
37
+ @repo.start_with?('http://', 'https://', 'git://', 'ssh://', 'git+ssh://', 'ssh+git://')
38
38
  end
39
39
 
40
40
  def get_absolute_repo_path
@@ -0,0 +1,13 @@
1
+ module ForemanTemplates
2
+ class Cleaner
3
+ def clean_up!
4
+ remove_settings
5
+ end
6
+
7
+ private
8
+
9
+ def remove_settings
10
+ Setting::TemplateSync.destroy_all
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanTemplates
2
- VERSION = '4.0.1'.freeze
2
+ VERSION = '4.0.2'.freeze
3
3
  end
@@ -57,6 +57,13 @@ namespace :templates do
57
57
  }).purge!
58
58
  end
59
59
 
60
+ desc 'Clean default data created by this plugin, this will permanently delete the data!'
61
+ task :cleanup => :environment do
62
+ puts 'Cleaning data...'
63
+ ForemanTemplates::Cleaner.new.clean_up!
64
+ puts 'Clean up finished, you can now remove the plugin from your system'
65
+ end
66
+
60
67
  end
61
68
 
62
69
  # Tests
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Sutcliffe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-03 00:00:00.000000000 Z
11
+ date: 2017-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diffy
@@ -54,6 +54,7 @@ files:
54
54
  - app/models/concerns/foreman_templates/template_import.rb
55
55
  - app/models/setting/template_sync.rb
56
56
  - app/services/foreman_templates/action.rb
57
+ - app/services/foreman_templates/cleaner.rb
57
58
  - app/services/foreman_templates/template_exporter.rb
58
59
  - app/services/foreman_templates/template_importer.rb
59
60
  - lib/foreman_templates.rb
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  version: '0'
81
82
  requirements: []
82
83
  rubyforge_project:
83
- rubygems_version: 2.5.1
84
+ rubygems_version: 2.4.5
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: Template-syncing engine for Foreman