Skip to content

Commit

Permalink
Merge pull request #1404 from mysteriumnetwork/tk/fix-vendor-flag
Browse files Browse the repository at this point in the history
Fix vendor CLI flag not being parsed
  • Loading branch information
tadaskay authored Nov 7, 2019
2 parents 2b05b67 + df0483d commit d7d0fc5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/flags_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cmd

import (
"github.com/mysteriumnetwork/node/config"
"github.com/mysteriumnetwork/node/config/urfavecli/cliflags"
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1/altsrc"

Expand Down Expand Up @@ -92,6 +93,7 @@ func RegisterFlagsNode(flags *[]cli.Flag) error {
// ParseFlagsNode function fills in node options from CLI context
func ParseFlagsNode(ctx *cli.Context) node.Options {
dirs := ParseFlagsDirectory(ctx)
cliflags.SetString(config.Current, config.VendorIDFlag.Name, ctx)
return node.Options{
LogOptions: logconfig.ParseFlags(ctx, dirs.Data),
Directories: dirs,
Expand Down
1 change: 0 additions & 1 deletion config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ var (
Name: "vendor.id",
Usage: "Marks vendor (distributor) of the node for collecting statistics. " +
"3rd party vendors may use their own identifier here.",
Value: "",
}
)
6 changes: 6 additions & 0 deletions config/urfavecli/cliflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
func SetString(cfg *config.Config, name string, ctx *cli.Context) {
if ctx.IsSet(name) {
cfg.SetCLI(name, ctx.String(name))
} else if ctx.GlobalIsSet(name) {
cfg.SetCLI(name, ctx.GlobalString(name))
} else {
cfg.RemoveCLI(name)
}
Expand All @@ -39,6 +41,8 @@ func SetString(cfg *config.Config, name string, ctx *cli.Context) {
func SetInt(cfg *config.Config, name string, ctx *cli.Context) {
if ctx.IsSet(name) {
cfg.SetCLI(name, ctx.Int(name))
} else if ctx.GlobalIsSet(name) {
cfg.SetCLI(name, ctx.GlobalInt(name))
} else {
cfg.RemoveCLI(name)
}
Expand All @@ -49,6 +53,8 @@ func SetInt(cfg *config.Config, name string, ctx *cli.Context) {
func SetBool(cfg *config.Config, name string, ctx *cli.Context) {
if ctx.IsSet(name) {
cfg.SetCLI(name, ctx.Bool(name))
} else if ctx.GlobalIsSet(name) {
cfg.SetCLI(name, ctx.GlobalBool(name))
} else {
cfg.RemoveCLI(name)
}
Expand Down
2 changes: 1 addition & 1 deletion mmn/node_information.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func CollectNodeData(client *client, resolver ip.Resolver) func(string) {
log.Error().Err(err).Msg("failed to send NodeInformation to MMN")
}

log.Info().Msg("Registered node to my.mysterium.network")
log.Info().Interface("info", info).Msg("Registered node to my.mysterium.network")
}
}

Expand Down

0 comments on commit d7d0fc5

Please sign in to comment.