mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-28 17:57:22 +03:00
Bug #2257: deterministic output for ruby 1.8.7
This commit is contained in:
parent
a067fb082d
commit
cb15b27ea0
@ -18,6 +18,8 @@
|
||||
|
||||
require "erb"
|
||||
|
||||
KEYS = [:MISC , :NET , :LVM , :ISCSI , :OVS , :XEN]
|
||||
|
||||
CMDS = {
|
||||
:MISC => %w(dd mkfs sync),
|
||||
:NET => %w(brctl ebtables iptables ip vconfig),
|
||||
@ -30,9 +32,10 @@ CMDS = {
|
||||
abs_cmds = {}
|
||||
not_found_cmds = []
|
||||
|
||||
CMDS.each do |label, cmds|
|
||||
_abs_cmds = []
|
||||
KEYS.each do |label|
|
||||
cmds = CMDS[label]
|
||||
|
||||
_abs_cmds = []
|
||||
cmds.each do |cmd|
|
||||
abs_cmd = `which #{cmd} 2>/dev/null`
|
||||
|
||||
@ -59,8 +62,10 @@ __END__
|
||||
Defaults !requiretty
|
||||
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
<% abs_cmds.each do |k,v| %>
|
||||
<% KEYS.each do |k|; v = abs_cmds["ONE_#{k}"] %>
|
||||
<% if !v.nil? %>
|
||||
Cmnd_Alias <%= k %> = <%= v.join(", ") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
oneadmin ALL=(ALL) NOPASSWD: <%= abs_cmds.keys.join(", ") %>
|
||||
oneadmin ALL=(ALL) NOPASSWD: <%= KEYS.select{|k| l="ONE_#{k}"; l if !abs_cmds[l].nil?}.join(", ") %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user