Skip to content

Commit 706ca7a

Browse files
committed
Cleanup
1 parent c8d6ad6 commit 706ca7a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

ecs-cli/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ package main
1616
import (
1717
"os"
1818

19-
"github.com/sirupsen/logrus"
20-
ecscompose "github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/compose/factory"
19+
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/compose/factory"
2120
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/commands/cluster"
2221
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/commands/compose"
2322
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/commands/configure"
@@ -28,6 +27,7 @@ import (
2827
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/utils/logger"
2928
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/version"
3029
"github.com/cihub/seelog"
30+
"github.com/sirupsen/logrus"
3131
"github.com/urfave/cli"
3232
)
3333

@@ -42,7 +42,7 @@ func main() {
4242
app.Version = version.String()
4343
app.Author = "Amazon Web Services"
4444

45-
composeFactory := ecscompose.NewProjectFactory()
45+
composeFactory := factory.NewProjectFactory()
4646

4747
app.Commands = []cli.Command{
4848
configureCommand.ConfigureCommand(),

ecs-cli/modules/config/config_v1.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const (
4040
yamlConfigVersion = 1
4141
)
4242

43-
// CLIConfig is the top level struct representing the configuration information
43+
// CLIConfig is the top level struct representing the local ECS configuration
4444
type CLIConfig struct {
4545
Version int // which format version was the config file that was read. 1 == yaml, 0 == old ini
4646
Cluster string
@@ -56,14 +56,14 @@ type CLIConfig struct {
5656
DefaultLaunchType string
5757
}
5858

59-
// Profile is a simple struct for storing a single profile config
59+
// Profile is a simple struct for storing a single AWS profile config
6060
type Profile struct {
6161
AWSAccessKey string `yaml:"aws_access_key_id"`
6262
AWSSecretKey string `yaml:"aws_secret_access_key"`
6363
AWSSessionToken string `yaml:"aws_session_token,omitempty"`
6464
}
6565

66-
// Cluster is a simple struct for storing a single cluster config
66+
// Cluster is a simple struct for storing a single ECS cluster config
6767
type Cluster struct {
6868
Cluster string `yaml:"cluster"`
6969
Region string `yaml:"region"`
@@ -92,7 +92,6 @@ func NewCLIConfig(cluster string) *CLIConfig {
9292
}
9393

9494
// ToAWSSession creates a new Session object from the CliConfig object.
95-
//
9695
// Region: Order of resolution
9796
// 1) ECS CLI Flags
9897
// a) Region Flag --region
@@ -140,7 +139,6 @@ func (cfg *CLIConfig) ToAWSSession(context *cli.Context) (*session.Session, erro
140139
// The argument svcConfig is needed to allow important unit tests to work
141140
// (for example: assume role)
142141
func (cfg *CLIConfig) toAWSSessionWithConfig(context *cli.Context, svcConfig *aws.Config) (*session.Session, error) {
143-
144142
region, err := cfg.getRegion()
145143

146144
if err != nil || region == "" {
@@ -209,6 +207,7 @@ func sessionFromProfile(profile string, region string, svcConfig *aws.Config) (*
209207
func sessionFromKeys(region string, awsAccess string, awsSecret string, sessionToken string, svcConfig *aws.Config) (*session.Session, error) {
210208
svcConfig.Region = aws.String(region)
211209
svcConfig.Credentials = credentials.NewStaticCredentials(awsAccess, awsSecret, sessionToken)
210+
212211
return session.NewSession(svcConfig)
213212
}
214213

@@ -241,6 +240,7 @@ func (cfg *CLIConfig) getRegion() (string, error) {
241240
if region == "" {
242241
region, err = cfg.getRegionFromAWSProfile()
243242
}
243+
244244
return region, err
245245
}
246246

@@ -259,6 +259,6 @@ func (cfg *CLIConfig) getRegionFromAWSProfile() (string, error) {
259259
if err != nil {
260260
return "", err
261261
}
262-
return aws.StringValue(s.Config.Region), nil
263262

263+
return aws.StringValue(s.Config.Region), nil
264264
}

0 commit comments

Comments
 (0)