Skip to content

Commit

Permalink
Merge pull request #970 from imjaroiswebdev/issue-967-unable-to-impor…
Browse files Browse the repository at this point in the history
…t-serv-deps

Address: Unable to import service dependencies
  • Loading branch information
imjaroiswebdev authored Jan 15, 2025
2 parents 98dd5d5 + d7793c7 commit 7b25333
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pagerdutyplugin/import_pagerduty_service_dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pagerduty

import (
"fmt"
"regexp"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
Expand Down Expand Up @@ -31,6 +32,13 @@ func TestAccPagerDutyServiceDependency_import(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
},

{
ResourceName: "pagerduty_service_dependency.foo",
ImportStateId: "wrongFormatID",
ImportState: true,
ExpectError: regexp.MustCompile(`Expecting an importation ID formed as`),
},
},
})
}
Expand Down
1 change: 1 addition & 0 deletions pagerdutyplugin/resource_pagerduty_service_dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ func (r *resourceServiceDependency) ImportState(ctx context.Context, req resourc
"Error importing pagerduty_service_dependency",
"Expecting an importation ID formed as '<supporting_service_id>.<supporting_service_type>.<service_dependency_id>'",
)
return
}
supID, supRt, id := ids[0], ids[1], ids[2]
serviceDependency, err := r.requestGetServiceDependency(ctx, id, supID, supRt)
Expand Down

0 comments on commit 7b25333

Please sign in to comment.