Skip to content

Commit b028757

Browse files
allow destroy operation on catalystcenter_assign_device_to_site if the device does not exist in the inventory (#262)
* allow destroy operation on catalystcenter_assign_device_to_site if the device does not exist in the inventory * update changelog
1 parent d6e1f3d commit b028757

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.1 (unreleased)
2+
3+
- Allow the destroy operation on `catalystcenter_assign_device_to_site` if the device has been removed from the inventory
4+
15
## 0.3.0
26

37
- Change data_source and import to use `wireless_profile_name` instead of `id` in `catalystcenter_wireless_profile`

docs/guides/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ description: |-
77

88
# Changelog
99

10+
## 0.3.1 (unreleased)
11+
12+
- Allow the destroy operation on `catalystcenter_assign_device_to_site` if the device has been removed from the inventory
13+
1014
## 0.3.0
1115

1216
- Change data_source and import to use `wireless_profile_name` instead of `id` in `catalystcenter_wireless_profile`

internal/provider/resource_catalystcenter_assign_device_to_site.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (r *AssignDeviceToSiteResource) Delete(ctx context.Context, req resource.De
270270
res, err := r.client.Post(state.getPathDelete()+params, body, cc.UseMutex)
271271
if err != nil {
272272
errorDetail := res.Get("response.detail").String()
273-
if strings.HasPrefix(errorDetail, "NCIM80106") {
273+
if strings.HasPrefix(errorDetail, "NCIM80106") || errorDetail == "Input data is invalid" {
274274
// This error means that the device was provisioned, and cannot be moved, so we need to ignore it.
275275
} else {
276276
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (POST), got error: %s, %s", err, res.String()))

templates/guides/changelog.md.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ description: |-
77

88
# Changelog
99

10+
## 0.3.1 (unreleased)
11+
12+
- Allow the destroy operation on `catalystcenter_assign_device_to_site` if the device has been removed from the inventory
13+
1014
## 0.3.0
1115

1216
- Change data_source and import to use `wireless_profile_name` instead of `id` in `catalystcenter_wireless_profile`

0 commit comments

Comments
 (0)