foreman_salt 3.0.1 → 3.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: bea1caeb04b5f73dc724c2d4bdd45e46055dbf80
4
- data.tar.gz: 21b7646d6d05aea5c7a393e1505910bc08efde11
3
+ metadata.gz: 044d6bcb7bb23ae885d02d14977aa289a86566ad
4
+ data.tar.gz: e3fdf276fedaf50ef67ea0128be66aeaa522ee3d
5
5
  SHA512:
6
- metadata.gz: 7ae9d028461860b4fac00233e19a8de3b74614c92278539d4848649c20fc632987f1cd1f33aa53c3d63c8de9e7831532e0f753f49317fe0147f1c9de2c8e1e3c
7
- data.tar.gz: 495c4414f5718ecc4d75ba82bada937b1cf799327f9adebe434a65ead4880eb45c4f79fc2717e5e66357691617e25809e6566409ba67375c9320d704aed0fea2
6
+ metadata.gz: 9b307a6679849af4beec034ab1a0e1957790845959b18458d483dec84b4d7dbd83fb4515749902d2149b3631be472d5b599d3e214e2a2d7d8dfcc86cc861922c
7
+ data.tar.gz: ad68170d5cd1c6cde132c80cba7d768d6b0b3d3dcdb5449415d5f37f6ecd75c88eb8883f0dc3742834832442571e8bf80dc19be5f97ffb90490f63a67181b6f2
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ [![Build Status](https://img.shields.io/jenkins/s/http/ci.theforeman.org/test_plugin_foreman_salt_master.svg)](http://ci.theforeman.org/job/test_plugin_foreman_salt_master)
2
+ [![Code Climate](https://codeclimate.com/github/theforeman/foreman_salt/badges/gpa.svg)](https://codeclimate.com/github/theforeman/foreman_salt)
3
+ [![GPL License](https://img.shields.io/github/license/theforeman/foreman_salt.svg)](https://github.com/theforeman/foreman_salt/blob/master/LICENSE)
4
+
1
5
  # Foreman Salt Plug-in
2
6
 
3
7
  This plug-in adds support for Salt to Foreman.
@@ -84,3 +84,42 @@ module ForemanSalt
84
84
  end
85
85
  end
86
86
  end
87
+
88
+ =begin
89
+ Minions controller? BANANA!!!
90
+
91
+ ────────────▀▄───█───▄▀
92
+ ───────────▄▄▄█▄▄█▄▄█▄▄▄
93
+ ────────▄▀▀═════════════▀▀▄
94
+ ───────█═══════════════════█
95
+ ──────█═════════════════════█
96
+ ─────█════════▄▄▄▄▄▄▄════════█
97
+ ────█════════█████████════════█
98
+ ────█═══════██▀─────▀██═══════█
99
+ ───███████████──█▀█──███████████
100
+ ───███████████──▀▀▀──███████████
101
+ ────█═══════▀█▄─────▄█▀═══════█
102
+ ────█═════════▀█████▀═════════█
103
+ ────█═════════════════════════█
104
+ ────█═════════════════════════█
105
+ ────█═══════█▀█▀█▀█▀█▀█═══════█
106
+ ────█═══════▀▄───────▄▀═══════█
107
+ ────█═════════▀▄█▄█▄▀═════════█
108
+ ────█═════════════════════════█
109
+ ───▐▓▓▌═════════════════════▐▓▓▌
110
+ ───▐▐▓▓▌▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▐▓▓▌▌
111
+ ───█══▐▓▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄▓▌══█
112
+ ──█══▌═▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌═▐══█
113
+ ──█══█═▐▓▓▓▓▓▓▄▄▄▄▄▄▄▓▓▓▓▓▓▌═█══█
114
+ ──█══█═▐▓▓▓▓▓▓▐██▀██▌▓▓▓▓▓▓▌═█══█
115
+ ──█══█═▐▓▓▓▓▓▓▓▀▀▀▀▀▓▓▓▓▓▓▓▌═█══█
116
+ ──█══█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█══█
117
+ ─▄█══█▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌█══█▄
118
+ ─█████▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌─█████
119
+ ─██████▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌─██████
120
+ ──▀█▀█──▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌───█▀█▀
121
+ ─────────▐▓▓▓▓▓▓▌▐▓▓▓▓▓▓▌
122
+ ──────────▐▓▓▓▓▌──▐▓▓▓▓▌
123
+ ─────────▄████▀────▀████▄
124
+ ─────────▀▀▀▀────────▀▀▀▀
125
+ =end
@@ -0,0 +1,20 @@
1
+ module ForemanSalt
2
+ module LayoutHelperExtensions
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ alias_method_chain :authorized_associations_permission_name, :salt
7
+ end
8
+
9
+ # Foreman tries to magically guess permission names, but it doesn't work
10
+ # with plugins. #11408 ForemanSalt models that require permissions provide
11
+ # a self.permission_name method
12
+ def authorized_associations_permission_name_with_salt(klass)
13
+ if klass.respond_to?(:permission_name)
14
+ klass.permission_name(:view)
15
+ else
16
+ authorized_associations_permission_name_without_salt(klass)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -35,7 +35,7 @@ module ForemanSalt
35
35
  def salt_modules_for_enc
36
36
  return [] unless salt_environment
37
37
  modules = salt_modules + (hostgroup ? hostgroup.all_salt_modules : [])
38
- ForemanSalt::SaltModule.in_environment(salt_environment).where(:id => modules).pluck(:name).uniq
38
+ ForemanSalt::SaltModule.in_environment(salt_environment).where(:id => modules).pluck("salt_modules.name").uniq
39
39
  end
40
40
 
41
41
  def salt_master
@@ -21,6 +21,10 @@ module ForemanSalt
21
21
  _('Salt environment')
22
22
  end
23
23
 
24
+ def self.permission_name(action)
25
+ "#{action}_salt_environments"
26
+ end
27
+
24
28
  private
25
29
 
26
30
  def remove_from_hosts(state)
@@ -42,5 +42,9 @@ module ForemanSalt
42
42
  def self.humanize_class_name(_name = nil)
43
43
  _('Salt state')
44
44
  end
45
+
46
+ def self.permission_name(action)
47
+ "#{action}_salt_modules"
48
+ end
45
49
  end
46
50
  end
@@ -172,6 +172,7 @@ module ForemanSalt
172
172
  # Helper Extensions
173
173
  ::HostsHelper.send :include, ForemanSalt::HostsHelperExtensions
174
174
  ::SmartProxiesHelper.send :include, ForemanSalt::SmartProxiesHelperExtensions
175
+ ::LayoutHelper.send :include, ForemanSalt::LayoutHelperExtensions
175
176
 
176
177
  # Model Extensions
177
178
  ::Host::Managed.send :include, ForemanSalt::Concerns::HostManagedExtensions
@@ -1,3 +1,3 @@
1
1
  module ForemanSalt
2
- VERSION = '3.0.1'
2
+ VERSION = '3.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_salt
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Benjamin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-13 00:00:00.000000000 Z
11
+ date: 2015-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -67,6 +67,7 @@ files:
67
67
  - app/controllers/foreman_salt/salt_modules_controller.rb
68
68
  - app/controllers/foreman_salt/state_importer.rb
69
69
  - app/helpers/concerns/foreman_salt/hosts_helper_extensions.rb
70
+ - app/helpers/concerns/foreman_salt/layout_helper_extensions.rb
70
71
  - app/helpers/concerns/foreman_salt/smart_proxies_helper_extensions.rb
71
72
  - app/helpers/foreman_salt/salt_keys_helper.rb
72
73
  - app/helpers/foreman_salt/salt_modules_helper.rb