Fix oca incompatibility with ruby 1.8.5

(cherry picked from commit 1a864ef3f1)
This commit is contained in:
Carlos Martín committed 2011-09-14 12:29:19 +02:00
1 parent d941d20ef3
commit bf5af7d060
1 file changed
+5 -1
+5 -1
View File
@@ -127,7 +127,11 @@ module OpenNebula
# Returns whether or not the user with id 'uid' is part of this group
def contains(uid)
return self["USERS/ID[.=#{uid}]"] != nil
# This doesn't work in ruby 1.8.5
# return self["USERS/ID[.=#{uid}]"] != nil
id_array = retrieve_elements('USERS/ID')
return id_array != nil && id_array.include?(uid.to_s)
end
# Returns an array with the numeric user ids