foreman_puppet 2.0.0 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/foreman_puppet/puppetclass_lookup_keys_helper.rb +1 -1
  3. data/db/migrate/20220201205305_migrate_host_class_permission.foreman_puppet.rb +9 -0
  4. data/db/migrate/20220208135305_migrate_environment_ignore_type.foreman_puppet.rb +15 -0
  5. data/db/migrate_foreman/20090905150132_create_hostgroups_puppetclasses.foreman_puppet.rb +3 -1
  6. data/db/migrate_foreman/20120824142048_add_some_indexes.foreman_puppet.rb +4 -4
  7. data/lib/foreman_puppet/register.rb +2 -1
  8. data/lib/foreman_puppet/version.rb +1 -1
  9. data/locale/ca/LC_MESSAGES/foreman_puppet.mo +0 -0
  10. data/locale/ca/foreman_puppet.edit.po +1095 -0
  11. data/locale/ca/foreman_puppet.po +70 -1
  12. data/locale/ca/foreman_puppet.po.time_stamp +0 -0
  13. data/locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo +0 -0
  14. data/locale/cs_CZ/foreman_puppet.edit.po +199 -184
  15. data/locale/cs_CZ/foreman_puppet.po +13 -2
  16. data/locale/de/LC_MESSAGES/foreman_puppet.mo +0 -0
  17. data/locale/de/foreman_puppet.edit.po +1122 -0
  18. data/locale/de/foreman_puppet.po +25 -13
  19. data/locale/de/foreman_puppet.po.time_stamp +0 -0
  20. data/locale/en/LC_MESSAGES/foreman_puppet.mo +0 -0
  21. data/locale/en/foreman_puppet.edit.po +33 -25
  22. data/locale/en/foreman_puppet.po +13 -1
  23. data/locale/en_GB/LC_MESSAGES/foreman_puppet.mo +0 -0
  24. data/locale/en_GB/foreman_puppet.edit.po +1097 -0
  25. data/locale/en_GB/foreman_puppet.po +13 -2
  26. data/locale/en_GB/foreman_puppet.po.time_stamp +0 -0
  27. data/locale/es/LC_MESSAGES/foreman_puppet.mo +0 -0
  28. data/locale/es/foreman_puppet.edit.po +1104 -0
  29. data/locale/es/foreman_puppet.po +13 -2
  30. data/locale/es/foreman_puppet.po.time_stamp +0 -0
  31. data/locale/foreman_puppet.pot +48 -25
  32. data/locale/fr/LC_MESSAGES/foreman_puppet.mo +0 -0
  33. data/locale/fr/foreman_puppet.edit.po +1112 -0
  34. data/locale/fr/foreman_puppet.po +13 -2
  35. data/locale/fr/foreman_puppet.po.time_stamp +0 -0
  36. data/locale/gl/LC_MESSAGES/foreman_puppet.mo +0 -0
  37. data/locale/gl/foreman_puppet.edit.po +1095 -0
  38. data/locale/gl/foreman_puppet.po +13 -2
  39. data/locale/gl/foreman_puppet.po.time_stamp +0 -0
  40. data/locale/it/LC_MESSAGES/foreman_puppet.mo +0 -0
  41. data/locale/it/foreman_puppet.edit.po +1099 -0
  42. data/locale/it/foreman_puppet.po +13 -2
  43. data/locale/it/foreman_puppet.po.time_stamp +0 -0
  44. data/locale/ja/LC_MESSAGES/foreman_puppet.mo +0 -0
  45. data/locale/ja/foreman_puppet.edit.po +1107 -0
  46. data/locale/ja/foreman_puppet.po +15 -4
  47. data/locale/ja/foreman_puppet.po.time_stamp +0 -0
  48. data/locale/ko/LC_MESSAGES/foreman_puppet.mo +0 -0
  49. data/locale/ko/foreman_puppet.edit.po +1096 -0
  50. data/locale/ko/foreman_puppet.po +13 -2
  51. data/locale/ko/foreman_puppet.po.time_stamp +0 -0
  52. data/locale/nl_NL/LC_MESSAGES/foreman_puppet.mo +0 -0
  53. data/locale/nl_NL/foreman_puppet.edit.po +1100 -0
  54. data/locale/nl_NL/foreman_puppet.po +13 -2
  55. data/locale/nl_NL/foreman_puppet.po.time_stamp +0 -0
  56. data/locale/pl/LC_MESSAGES/foreman_puppet.mo +0 -0
  57. data/locale/pl/foreman_puppet.edit.po +1099 -0
  58. data/locale/pl/foreman_puppet.po +13 -2
  59. data/locale/pl/foreman_puppet.po.time_stamp +0 -0
  60. data/locale/pt_BR/LC_MESSAGES/foreman_puppet.mo +0 -0
  61. data/locale/pt_BR/foreman_puppet.edit.po +1103 -0
  62. data/locale/pt_BR/foreman_puppet.po +13 -2
  63. data/locale/pt_BR/foreman_puppet.po.time_stamp +0 -0
  64. data/locale/ru/LC_MESSAGES/foreman_puppet.mo +0 -0
  65. data/locale/ru/foreman_puppet.edit.po +1104 -0
  66. data/locale/ru/foreman_puppet.po +15 -4
  67. data/locale/ru/foreman_puppet.po.time_stamp +0 -0
  68. data/locale/sv_SE/LC_MESSAGES/foreman_puppet.mo +0 -0
  69. data/locale/sv_SE/foreman_puppet.edit.po +1099 -0
  70. data/locale/sv_SE/foreman_puppet.po +13 -2
  71. data/locale/sv_SE/foreman_puppet.po.time_stamp +0 -0
  72. data/locale/zh_CN/LC_MESSAGES/foreman_puppet.mo +0 -0
  73. data/locale/zh_CN/foreman_puppet.edit.po +1108 -0
  74. data/locale/zh_CN/foreman_puppet.po +16 -5
  75. data/locale/zh_CN/foreman_puppet.po.time_stamp +0 -0
  76. data/locale/zh_TW/LC_MESSAGES/foreman_puppet.mo +0 -0
  77. data/locale/zh_TW/foreman_puppet.edit.po +1098 -0
  78. data/locale/zh_TW/foreman_puppet.po +13 -2
  79. data/locale/zh_TW/foreman_puppet.po.time_stamp +0 -0
  80. data/test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb +34 -0
  81. metadata +39 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c850f32331462f52510a8e895c149eb470e9982ad819de78529c38c888ab549c
4
- data.tar.gz: 81460cb582b62baa3f96083c3573a99607a9b2619d2a20c31df4f41da48677c6
3
+ metadata.gz: 7b1f794eadfcdfbc3e2b516b5e54ded28e14b5dbf5472864317e7eabf4a75976
4
+ data.tar.gz: 65e754ff457d4e3ddc39147385429077230e633d7d33ca6262d2dff24c1803f6
5
5
  SHA512:
6
- metadata.gz: f0b20469d894d6a1cc2e8c6f486ef5f09dd9c04742c0be684f68846fe930536a813ee404fb30af2ba0ae9031df6c2c00ea3a4af0233be5b24640b81d2a58d031
7
- data.tar.gz: 16cab8e0431a72b04795046e4e66ca67a029247f4bf182a7a3f36e7ec8f2c5d45a1ae3db4ce8d96a48869a698eebec284eef6d9c0290d10270c41ab19789d0ee
6
+ metadata.gz: 829a43c406bbdf51b3c2b3508189f283f0dddcb44c4dd9fa578afdffc9369f8f3e06836b700001efb267c1020e917c2b3f84e88bdc4f1edc8feb509f0a896154
7
+ data.tar.gz: c36b9a9f727417795cb169e371ad2ba7df5274ad58333eebfd38327c54f7dba20fe2e75730f68b29d749b48f6f5b4a8fff2c37e75f952d079463feceb3b19fb0
@@ -9,7 +9,7 @@ module ForemanPuppet
9
9
  # ------ Host(group) Form Helpers -----
10
10
 
11
11
  def overridable_puppet_lookup_keys(klass, obj)
12
- klass.class_params.override.where(environment_classes: { environment_id: obj.environment_id })
12
+ klass.class_params.override.where(environment_classes: { environment_id: obj.environment })
13
13
  end
14
14
 
15
15
  def hidden_puppet_lookup_value_fields(lookup_key, lookup_value, disabled)
@@ -0,0 +1,9 @@
1
+ class MigrateHostClassPermission < ActiveRecord::Migration[6.0]
2
+ def up
3
+ Permission.where(resource_type: 'HostClass').update_all(resource_type: 'ForemanPuppet::HostClass')
4
+ end
5
+
6
+ def down
7
+ # no can do
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ class MigrateEnvironmentIgnoreType < ActiveRecord::Migration[6.0]
2
+ def up
3
+ taxonomies = Taxonomy.unscoped.where("ignore_types LIKE '%Environment%'")
4
+ environment_ids = ForemanPuppet::Environment.unscoped.pluck(:id)
5
+
6
+ taxonomies.each do |tax|
7
+ new_types = tax.ignore_types.reject { |type| type == 'Environment' }
8
+ tax.update_columns(ignore_types: new_types)
9
+ taxable_rows = environment_ids.map do |env_id|
10
+ { taxable_id: env_id, taxable_type: 'ForemanPuppet::Environment', taxonomy_id: tax.id }
11
+ end
12
+ TaxableTaxonomy.insert_all(taxable_rows) if taxable_rows.any?
13
+ end
14
+ end
15
+ end
@@ -1,6 +1,8 @@
1
1
  class CreateHostgroupsPuppetclasses < ActiveRecord::Migration[6.0]
2
2
  def up
3
- create_table :hostgroups_puppetclasses, id: false, if_not_exists: true do |t|
3
+ # this table is later renamed into hostgroup_classes and thus we don't want to create it if it exists under the later name
4
+ return if table_exists?(:hostgroups_puppetclasses) || table_exists?(:hostgroup_classes)
5
+ create_table :hostgroups_puppetclasses, id: false do |t|
4
6
  t.references :hostgroup, foreign_key: true, null: false
5
7
  t.references :puppetclass, foreign_key: true, null: false
6
8
  end
@@ -13,9 +13,9 @@ class AddSomeIndexes < ActiveRecord::Migration[4.2]
13
13
  end
14
14
 
15
15
  def down
16
- remove_foreign_key 'host_classes', 'hosts', name: 'host_classes_host_id_fk'
17
- remove_foreign_key 'host_classes', 'puppetclasses', name: 'host_classes_puppetclass_id_fk'
18
- remove_foreign_key 'operatingsystems_puppetclasses', 'operatingsystems', name: 'operatingsystems_puppetclasses_operatingsystem_id_fk'
19
- remove_foreign_key 'operatingsystems_puppetclasses', 'puppetclasses', name: 'operatingsystems_puppetclasses_puppetclass_id_fk'
16
+ remove_foreign_key('host_classes', 'hosts') if foreign_key_exists?(:host_classes, :hosts)
17
+ remove_foreign_key('host_classes', 'puppetclasses') if foreign_key_exists?(:host_classes, :puppetclasses)
18
+ remove_foreign_key('operatingsystems_puppetclasses', 'operatingsystems') if foreign_key_exists?(:operatingsystems_puppetclasses, :operatingsystems)
19
+ remove_foreign_key('operatingsystems_puppetclasses', 'puppetclasses') if foreign_key_exists?(:operatingsystems_puppetclasses, :puppetclasses)
20
20
  end
21
21
  end
@@ -147,7 +147,8 @@ Foreman::Plugin.register :foreman_puppet do
147
147
  permission :import_puppetclasses, { 'foreman_puppet/puppetclasses' => %i[import_environments obsolete_and_new],
148
148
  'foreman_puppet/api/v2/environments' => [:import_puppetclasses] },
149
149
  resource_type: 'ForemanPuppet::Puppetclass'
150
- permission :edit_classes, { 'foreman_puppet/api/v2/host_classes': %i[index create destroy] },
150
+ permission :edit_classes, { :host_editing => [:edit_classes],
151
+ 'foreman_puppet/api/v2/host_classes' => %i[index create destroy] },
151
152
  resource_type: 'ForemanPuppet::HostClass'
152
153
  end
153
154
 
@@ -1,3 +1,3 @@
1
1
  module ForemanPuppet
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.4'.freeze
3
3
  end