lib/fog/aws/models/iam/access_key.rb in fog-1.16.0 vs lib/fog/aws/models/iam/access_key.rb in fog-1.17.0
- old
+ new
@@ -12,10 +12,14 @@
attribute :status, :aliases => 'Status'
def save
requires :username
- data = service.create_access_key('UserName'=> username).body["AccessKey"]
+ if !persisted?
+ data = service.create_access_key('UserName'=> username).body["AccessKey"]
+ else
+ data = service.update_access_key(id, status, "UserName" => username).body["AccessKey"]
+ end
merge_attributes(data)
true
end
def destroy