chore: tidy and code cleanup
This commit is contained in:
parent
d2b6178350
commit
ad45a540f0
6 changed files with 7 additions and 14 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||
"github.com/caarlos0/log"
|
||||
)
|
||||
|
||||
// An struct that's meant to extend functionality of the base HTTP client by
|
||||
|
|
@ -57,7 +58,7 @@ func (client *SmdClient) FetchEthernetInterfaces(verbose bool) ([]configurator.E
|
|||
|
||||
// print what we got if verbose is set
|
||||
if verbose {
|
||||
fmt.Printf("Ethernet Interfaces: %v\n", string(bytes))
|
||||
log.Info().Str("ethernet_interfaces", string(bytes)).Msg("found interfaces")
|
||||
}
|
||||
|
||||
return eths, nil
|
||||
|
|
@ -99,7 +100,7 @@ func (client *SmdClient) FetchComponents(verbose bool) ([]configurator.Component
|
|||
|
||||
// print what we got if verbose is set
|
||||
if verbose {
|
||||
fmt.Printf("Components: %v\n", string(bytes))
|
||||
log.Info().Str("components", string(bytes)).Msg("found components")
|
||||
}
|
||||
|
||||
return comps, nil
|
||||
|
|
@ -138,7 +139,7 @@ func (client *SmdClient) FetchRedfishEndpoints(verbose bool) ([]configurator.Red
|
|||
|
||||
// show the final result
|
||||
if verbose {
|
||||
fmt.Printf("Redfish endpoints: %v\n", string(b))
|
||||
log.Info().Str("redfish_endpoints", string(b)).Msg("found redfish endpoints")
|
||||
}
|
||||
|
||||
return eps, nil
|
||||
|
|
|
|||
|
|
@ -54,10 +54,6 @@ func (g *DHCPd) Generate(config *config.Config, params Params) (FileMap, error)
|
|||
computeNodes += fmt.Sprintf("host %s { hardware ethernet %s; fixed-address %s} ", eth.ComponentId, eth.MacAddress, eth.IpAddresses[0])
|
||||
}
|
||||
computeNodes += "# ====================================================================="
|
||||
|
||||
if params.Verbose {
|
||||
fmt.Printf("")
|
||||
}
|
||||
return ApplyTemplates(Mappings{
|
||||
"plugin_name": g.GetName(),
|
||||
"plugin_version": g.GetVersion(),
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ func LoadPlugins(dirpath string, opts ...Option) (map[string]Generator, error) {
|
|||
|
||||
// show the plugins found if verbose flag is set
|
||||
if params.Verbose {
|
||||
fmt.Printf("-- found plugin '%s'\n", gen.GetName())
|
||||
log.Info().Str("plugin_name", gen.GetName()).Msg("found plugin")
|
||||
}
|
||||
|
||||
// map each generator plugin by name for lookup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue