mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/devp2p: address code review issues
This commit is contained in:
parent
847445ba86
commit
23d0ba88be
2 changed files with 8 additions and 9 deletions
|
|
@ -34,13 +34,13 @@ import (
|
||||||
var (
|
var (
|
||||||
route53AccessKeyFlag = cli.StringFlag{
|
route53AccessKeyFlag = cli.StringFlag{
|
||||||
Name: "access-key-id",
|
Name: "access-key-id",
|
||||||
Usage: "Route53 Access Key ID",
|
Usage: "AWS Access Key ID",
|
||||||
EnvVar: "ROUTE53_ACCESS_KEY_ID",
|
EnvVar: "AWS_ACCESS_KEY_ID",
|
||||||
}
|
}
|
||||||
route53AccessSecretFlag = cli.StringFlag{
|
route53AccessSecretFlag = cli.StringFlag{
|
||||||
Name: "access-key-secret",
|
Name: "access-key-secret",
|
||||||
Usage: "Route53 Access Key Secret",
|
Usage: "AWS Access Key Secret",
|
||||||
EnvVar: "ROUTE53_ACCESS_KEY_SECRET",
|
EnvVar: "AWS_SECRET_ACCESS_KEY",
|
||||||
}
|
}
|
||||||
route53ZoneIDFlag = cli.StringFlag{
|
route53ZoneIDFlag = cli.StringFlag{
|
||||||
Name: "zone-id",
|
Name: "zone-id",
|
||||||
|
|
@ -53,8 +53,8 @@ type route53Client struct {
|
||||||
zoneID string
|
zoneID string
|
||||||
}
|
}
|
||||||
|
|
||||||
// newRoute53 sets up a Route53 API client from command line flags.
|
// newRoute53Client sets up a Route53 API client from command line flags.
|
||||||
func newRoute53(ctx *cli.Context) *route53Client {
|
func newRoute53Client(ctx *cli.Context) *route53Client {
|
||||||
akey := ctx.String(route53AccessKeyFlag.Name)
|
akey := ctx.String(route53AccessKeyFlag.Name)
|
||||||
asec := ctx.String(route53AccessSecretFlag.Name)
|
asec := ctx.String(route53AccessSecretFlag.Name)
|
||||||
if akey == "" || asec == "" {
|
if akey == "" || asec == "" {
|
||||||
|
|
@ -64,7 +64,6 @@ func newRoute53(ctx *cli.Context) *route53Client {
|
||||||
session, err := session.NewSession(config)
|
session, err := session.NewSession(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
exit(fmt.Errorf("can't create AWS session: %v", err))
|
exit(fmt.Errorf("can't create AWS session: %v", err))
|
||||||
exit(err)
|
|
||||||
}
|
}
|
||||||
return &route53Client{
|
return &route53Client{
|
||||||
api: route53.New(session),
|
api: route53.New(session),
|
||||||
|
|
@ -85,7 +84,7 @@ func (c *route53Client) deploy(name string, t *dnsdisc.Tree) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(changes) == 0 {
|
if len(changes) == 0 {
|
||||||
log.Info(fmt.Sprintf("No DNS changes needed"))
|
log.Info("No DNS changes needed")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ func dnsToRoute53(ctx *cli.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
client := newRoute53(ctx)
|
client := newRoute53Client(ctx)
|
||||||
return client.deploy(domain, t)
|
return client.deploy(domain, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue