Skip to content

Commit fa8256f

Browse files
authored
Merge pull request #145 from darkbitio/build
Build
2 parents 729eebf + 3e3520e commit fa8256f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

lib/aws_recon/collectors/organizations.rb

+12-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ def collect
1313
#
1414
# describe_organization
1515
#
16-
@client.describe_organization.each do |response|
17-
log(response.context.operation_name)
16+
begin
17+
@client.describe_organization.each do |response|
18+
log(response.context.operation_name)
1819

19-
struct = OpenStruct.new(response.organization.to_h)
20-
struct.type = 'organization'
20+
struct = OpenStruct.new(response.organization.to_h)
21+
struct.type = 'organization'
2122

22-
resources.push(struct.to_h)
23+
resources.push(struct.to_h)
24+
end
25+
rescue Aws::Organizations::Errors::ServiceError => e
26+
log_error(e.code)
27+
28+
raise e unless suppressed_errors.include?(e.code) && !@options.quit_on_exception
2329
end
2430

2531
#
@@ -66,6 +72,7 @@ def collect
6672
def suppressed_errors
6773
%w[
6874
AccessDeniedException
75+
AWSOrganizationsNotInUseException
6976
]
7077
end
7178
end

lib/aws_recon/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module AwsRecon
2-
VERSION = "0.5.21"
2+
VERSION = "0.5.22"
33
end

0 commit comments

Comments
 (0)