diff --git a/govcd/user_test.go b/govcd/user_test.go index 967f2091b..d521f04f7 100644 --- a/govcd/user_test.go +++ b/govcd/user_test.go @@ -184,6 +184,19 @@ func (vcd *TestVCD) Test_UserCRUD(check *C) { check.Assert(user.User.DeployedVmQuota, Equals, userDefinition.DeployedVmQuota) check.Assert(user.User.IsExternal, Equals, userDefinition.IsExternal) + // change DeployedVmQuota and StoredVmQuota to 0 and assert + // this will make DeployedVmQuota and StoredVmQuota unlimited + user.User.DeployedVmQuota = 0 + user.User.StoredVmQuota = 0 + err = user.Update() + check.Assert(err, IsNil) + + // Get the user from API again + user, err = adminOrg.GetUserByHref(user.User.Href) + check.Assert(err, IsNil) + check.Assert(user.User.DeployedVmQuota, Equals, 0) + check.Assert(user.User.StoredVmQuota, Equals, 0) + err = user.Disable() check.Assert(err, IsNil) check.Assert(user.User.IsEnabled, Equals, false) diff --git a/types/v56/types.go b/types/v56/types.go index b9c712cd9..ebccdf6aa 100644 --- a/types/v56/types.go +++ b/types/v56/types.go @@ -2873,8 +2873,8 @@ type User struct { IsExternal bool `xml:"IsExternal,omitempty"` ProviderType string `xml:"ProviderType,omitempty"` IsGroupRole bool `xml:"IsGroupRole,omitempty"` - StoredVmQuota int `xml:"StoredVmQuota,omitempty"` - DeployedVmQuota int `xml:"DeployedVmQuota,omitempty"` + StoredVmQuota int `xml:"StoredVmQuota"` + DeployedVmQuota int `xml:"DeployedVmQuota"` Role *Reference `xml:"Role,omitempty"` GroupReferences *GroupReference `xml:"GroupReferences,omitempty"` Password string `xml:"Password,omitempty"`