Merge pull request #830 from cloudskiff/issue_823_use_supportedtype
Use SupportedType() in enumeratormain
commit
9cb7a57e28
|
@ -31,7 +31,7 @@ func (e *Route53RecordEnumerator) Enumerate() ([]resource.Resource, error) {
|
|||
|
||||
zones, err := e.client.ListAllZones()
|
||||
if err != nil {
|
||||
return nil, remoteerror.NewResourceEnumerationErrorWithType(err, resourceaws.AwsRoute53RecordResourceType, resourceaws.AwsRoute53ZoneResourceType)
|
||||
return nil, remoteerror.NewResourceEnumerationErrorWithType(err, string(e.SupportedType()), resourceaws.AwsRoute53ZoneResourceType)
|
||||
}
|
||||
|
||||
results := make([]resource.Resource, len(zones))
|
||||
|
@ -39,7 +39,7 @@ func (e *Route53RecordEnumerator) Enumerate() ([]resource.Resource, error) {
|
|||
for _, hostedZone := range zones {
|
||||
records, err := e.listRecordsForZone(strings.TrimPrefix(*hostedZone.Id, "/hostedzone/"))
|
||||
if err != nil {
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsRoute53RecordResourceType)
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType()))
|
||||
}
|
||||
|
||||
results = append(results, records...)
|
||||
|
|
|
@ -30,7 +30,7 @@ func (e *Route53ZoneSupplier) SupportedType() resource.ResourceType {
|
|||
func (e *Route53ZoneSupplier) Enumerate() ([]resource.Resource, error) {
|
||||
zones, err := e.client.ListAllZones()
|
||||
if err != nil {
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsRoute53ZoneResourceType)
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType()))
|
||||
}
|
||||
|
||||
results := make([]resource.Resource, len(zones))
|
||||
|
|
|
@ -29,7 +29,7 @@ func (e *VPCDefaultSecurityGroupEnumerator) SupportedType() resource.ResourceTyp
|
|||
func (e *VPCDefaultSecurityGroupEnumerator) Enumerate() ([]resource.Resource, error) {
|
||||
_, defaultSecurityGroups, err := e.repository.ListAllSecurityGroups()
|
||||
if err != nil {
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsSecurityGroupResourceType)
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType()))
|
||||
}
|
||||
|
||||
results := make([]resource.Resource, 0, len(defaultSecurityGroups))
|
||||
|
|
|
@ -29,7 +29,7 @@ func (e *VPCSecurityGroupEnumerator) SupportedType() resource.ResourceType {
|
|||
func (e *VPCSecurityGroupEnumerator) Enumerate() ([]resource.Resource, error) {
|
||||
securityGroups, _, err := e.repository.ListAllSecurityGroups()
|
||||
if err != nil {
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsSecurityGroupResourceType)
|
||||
return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType()))
|
||||
}
|
||||
|
||||
results := make([]resource.Resource, 0, len(securityGroups))
|
||||
|
|
Loading…
Reference in New Issue