1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Fix oca incompatibility with ruby 1.8.5

This commit is contained in:
Carlos Martín 2011-09-14 12:27:08 +02:00
parent 1ff5ae0f0e
commit 1a864ef3f1

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