Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some vtctld commands failing to return information to vtctlclient #4647

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions go/vt/vtctl/vtctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ import (
"vitess.io/vitess/go/sync2"
hk "vitess.io/vitess/go/vt/hook"
"vitess.io/vitess/go/vt/key"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/schemamanager"
"vitess.io/vitess/go/vt/sqlparser"
Expand Down Expand Up @@ -502,7 +501,7 @@ func dumpTablets(ctx context.Context, wr *wrangler.Wrangler, tabletAliases []*to
for _, tabletAlias := range tabletAliases {
ti, ok := tabletMap[topoproto.TabletAliasString(tabletAlias)]
if !ok {
log.Warningf("failed to load tablet %v", tabletAlias)
wr.Logger().Warningf("failed to load tablet %v", tabletAlias)
} else {
wr.Logger().Printf("%v\n", fmtTabletAwkable(ti))
}
Expand Down Expand Up @@ -1158,7 +1157,7 @@ func commandCreateShard(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl

err = wr.TopoServer().CreateShard(ctx, keyspace, shard)
if *force && topo.IsErrType(err, topo.NodeExists) {
log.Infof("shard %v/%v already exists (ignoring error with -force)", keyspace, shard)
wr.Logger().Infof("shard %v/%v already exists (ignoring error with -force)", keyspace, shard)
err = nil
}
return err
Expand Down Expand Up @@ -1485,7 +1484,7 @@ func commandDeleteShard(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl
case err == nil:
// keep going
case topo.IsErrType(err, topo.NoNode):
log.Infof("Shard %v/%v doesn't exist, skipping it", ks.Keyspace, ks.Shard)
wr.Logger().Infof("Shard %v/%v doesn't exist, skipping it", ks.Keyspace, ks.Shard)
default:
return err
}
Expand Down Expand Up @@ -1790,7 +1789,7 @@ func commandValidate(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.
}

if subFlags.NArg() != 0 {
log.Warningf("action Validate doesn't take any parameter any more")
wr.Logger().Warningf("action Validate doesn't take any parameter any more")
}
return wr.Validate(ctx, *pingTablets)
}
Expand Down Expand Up @@ -2065,7 +2064,7 @@ func commandGetPermissions(ctx context.Context, wr *wrangler.Wrangler, subFlags
}
p, err := wr.GetPermissions(ctx, tabletAlias)
if err == nil {
log.Infof("%v", p.String()) // they can contain '%'
wr.Logger().Infof("%v", p.String()) // they can contain '%'
}
return err
}
Expand Down