1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[openstack|identity] Update users model initialization and save

This commit is contained in:
Alvin Garcia 2012-03-09 20:46:17 +08:00 committed by Nelvin Driz
parent 040cd20021
commit 8d084194b4

View file

@ -16,13 +16,13 @@ module Fog
def initialize(attributes)
@connection = attributes[:connection]
attributes[:enabled] ||= true
super
end
def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
requires :name, :tenant_id, :password
enabled = true if enabled.nil?
data = connection.create_user(name, password, email, tenant_id, enabled)
merge_attributes(data.body['user'])
true