mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-09 22:39:53 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+11
-4
@@ -29,10 +29,6 @@ func init() {
|
||||
logLevel = aws.LogLevel(aws.LogDebugWithSigning | aws.LogDebugWithHTTPBody)
|
||||
}
|
||||
Session.Config.LogLevel = logLevel
|
||||
|
||||
if aws.StringValue(Session.Config.Region) == "" {
|
||||
panic("AWS_REGION must be configured to run integration tests")
|
||||
}
|
||||
}
|
||||
|
||||
// UniqueID returns a unique UUID-like identifier for use in generating
|
||||
@@ -42,3 +38,14 @@ func UniqueID() string {
|
||||
io.ReadFull(rand.Reader, uuid)
|
||||
return fmt.Sprintf("%x", uuid)
|
||||
}
|
||||
|
||||
// SessionWithDefaultRegion returns a copy of the integration session with the
|
||||
// region set if one was not already provided.
|
||||
func SessionWithDefaultRegion(region string) *session.Session {
|
||||
sess := Session.Copy()
|
||||
if v := aws.StringValue(sess.Config.Region); len(v) == 0 {
|
||||
sess.Config.Region = aws.String(region)
|
||||
}
|
||||
|
||||
return sess
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user