Skip to content

Commit

Permalink
Merge pull request #383 from LBGarber/fix-stackscript-read
Browse files Browse the repository at this point in the history
Fix missing StackScript check
  • Loading branch information
0xch4z authored Jul 19, 2021
2 parents 1ceaa41 + d3e0e62 commit b38781a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linode/resource_linode_stackscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func resourceLinodeStackscriptRead(d *schema.ResourceData, meta interface{}) err

stackscript, err := client.GetStackscript(context.Background(), int(id))
if err != nil {
if lerr, ok := err.(*linodego.Error); ok && lerr.Code == 404 {
if lerr, ok := err.(*linodego.Error); ok && lerr.Code == 401 {
log.Printf("[WARN] removing StackScript ID %q from state because it no longer exists", d.Id())
d.SetId("")
return nil
Expand Down

0 comments on commit b38781a

Please sign in to comment.