foreman_ovirt 0.1.0 → 0.2.0
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.
- data/README.rdoc +5 -8
- data/VERSION +1 -1
- data/app/models/foreman_ovirt/user_extensions.rb +6 -5
- data/config/initializers/ovirt_setup.rb +4 -1
- data/foreman_ovirt.gemspec +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -4,17 +4,14 @@ Test engine for ovirt-foreman integration
|
|
4
4
|
|
5
5
|
= Install
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
gem 'foreman_ovirt'
|
10
|
-
|
11
|
-
Currently, you must use the branch "test_engine" under "https://github.com/isratrade/foreman" since this version removes the catchall in routes.rb and v1.rb and adds a forward slash to :controller => '/unattended' in hosts_helper.rb.
|
7
|
+
1. gem install foreman_ovirt
|
8
|
+
2. Add bundler.d folder in Foreman a file called foreman_ovirt, containing the line:
|
9
|
+
gem 'foreman_ovirt'
|
12
10
|
|
13
11
|
= Usage
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
Example: localhost/hosts/foreman-test.sat.lab.tlv.redhat.com/ovirt
|
13
|
+
See the README-foreman-plugin in the oVirt plugin repository (http://gerrit.ovirt.org/p/samples-uiplugins.git) for guidelines on what to do in the oVirt engine server.
|
14
|
+
Also see ovedou.blogspot.com for more information, as I have a blog post on that.
|
18
15
|
|
19
16
|
== Copyright
|
20
17
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -7,17 +7,18 @@ module ForemanOvirt
|
|
7
7
|
|
8
8
|
module InstanceMethods
|
9
9
|
def add_role_to_user
|
10
|
+
logger.debug "add_role_to_user started"
|
10
11
|
user_auth_source = AuthSource.find(auth_source)
|
11
|
-
|
12
|
-
|
12
|
+
logger.debug "auth source is: " + user_auth_source.type
|
13
|
+
if (user_auth_source && user_auth_source.type == "ForemanOvirt::AuthSourceOvirt")
|
14
|
+
# Checking auth_source is oVirt
|
13
15
|
ovirt_role_id = Role.find_by_name("Ovirt").id
|
14
16
|
if (!user_roles.find_by_role_id(ovirt_role_id))
|
15
|
-
|
17
|
+
logger.debug "adding oVirt role to user " + name
|
16
18
|
user_roles.create(:role_id => ovirt_role_id)
|
17
|
-
puts "add_role_to_user"
|
18
19
|
end
|
19
20
|
end
|
20
|
-
|
21
|
+
end
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# Requiring the foreman_ovirt bundler group
|
2
|
+
Bundler.require(:foreman_ovirt)
|
3
|
+
|
1
4
|
# Add permissions
|
2
5
|
Foreman::AccessControl.map do |map|
|
3
6
|
map.security_block :ovirt do |map|
|
@@ -24,4 +27,4 @@ ForemanOvirt::AuthSourceOvirt.transaction do
|
|
24
27
|
tls = url.scheme == "https" ? true : false
|
25
28
|
ForemanOvirt::AuthSourceOvirt.create(:name => name, :host => url.host, :port => url.port, :onthefly_register => true, :tls => tls)
|
26
29
|
end
|
27
|
-
end
|
30
|
+
end
|
data/foreman_ovirt.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_ovirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Oved Ourfali
|