From 6aff18dcd060631f98d71ead6f8178d2266b6250 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Wed, 30 Oct 2019 14:29:35 -0400 Subject: [PATCH] plugins device: remove trace level containing config contents --- plugins/shared/cmd/launcher/command/device.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/plugins/shared/cmd/launcher/command/device.go b/plugins/shared/cmd/launcher/command/device.go index 5b4d86529..fe2d2ffaf 100644 --- a/plugins/shared/cmd/launcher/command/device.go +++ b/plugins/shared/cmd/launcher/command/device.go @@ -22,7 +22,6 @@ import ( "github.com/hashicorp/nomad/plugins/device" "github.com/kr/pretty" "github.com/mitchellh/cli" - "github.com/zclconf/go-cty/cty/msgpack" ) func DeviceCommandFactory(meta Meta) cli.CommandFactory { @@ -100,8 +99,6 @@ func (c *Device) Run(args []string) int { c.logger.Error("failed to read config file", "error", err) return 1 } - - c.logger.Trace("read config", "config", string(config)) } // Get the plugin @@ -173,8 +170,6 @@ func (c *Device) getSpec() (hcldec.Spec, error) { return nil, fmt.Errorf("failed to get config schema: %v", err) } - c.logger.Trace("device spec", "spec", hclog.Fmt("% #v", pretty.Formatter(spec))) - // Convert the schema schema, diag := hclspecutils.Convert(spec) if diag.HasErrors() { @@ -195,18 +190,10 @@ func (c *Device) setConfig(spec hcldec.Spec, apiVersion string, config []byte, n return err } - c.logger.Trace("raw hcl config", "config", hclog.Fmt("% #v", pretty.Formatter(configVal))) - - val, diag, diagErrs := hclutils.ParseHclInterface(configVal, spec, nil) + _, diag, diagErrs := hclutils.ParseHclInterface(configVal, spec, nil) if diag.HasErrors() { return multierror.Append(errors.New("failed to parse config: "), diagErrs...) } - c.logger.Trace("parsed hcl config", "config", hclog.Fmt("% #v", pretty.Formatter(val))) - - cdata, err := msgpack.Marshal(val, val.Type()) - if err != nil { - return err - } req := &base.Config{ PluginConfig: cdata, @@ -214,7 +201,6 @@ func (c *Device) setConfig(spec hcldec.Spec, apiVersion string, config []byte, n ApiVersion: apiVersion, } - c.logger.Trace("msgpack config", "config", string(cdata)) if err := c.dev.SetConfig(req); err != nil { return err }