Skip to content

Commit

Permalink
Merge pull request #43 from k1LoW/refactor-next_page
Browse files Browse the repository at this point in the history
Use `Seahorse::Client::Response.next_page?`
  • Loading branch information
k1LoW committed Sep 11, 2015
2 parents 2507a38 + 14831c5 commit b830343
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/awspec/stub/iam_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
],
is_truncated: false,
maker: nil
marker: nil
}
}
}
2 changes: 1 addition & 1 deletion lib/awspec/stub/iam_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
is_truncated: false,
maker: nil
marker: nil
}
}
}
2 changes: 1 addition & 1 deletion lib/awspec/stub/iam_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
],
is_truncated: false,
maker: nil
marker: nil
}
}
}
13 changes: 6 additions & 7 deletions lib/awspec/type/rds_db_parameter_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ class RdsDbParameterGroup < Base
def initialize(name)
super
@parameters = {}
res = @rds_client.describe_db_parameters({
db_parameter_group_name: name
})

marker = nil
while @parameters.empty? || !marker.nil?
res = @rds_client.describe_db_parameters(
db_parameter_group_name: name,
marker: marker)
marker = res.marker
break if res.parameters.empty?
loop do
res.parameters.each do |param|
@parameters[param.parameter_name] = param.parameter_value
end
(res.next_page? && res = res.next_page) || break
end

@id = name unless @parameters.empty?
@resource = @parameters
end
Expand Down

0 comments on commit b830343

Please sign in to comment.