Skip to content

Commit

Permalink
Print yip output to installPanel if applyNetworks() fails
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Serong <[email protected]>
  • Loading branch information
tserong authored and bk201 committed May 23, 2024
1 parent a5fd14b commit db9cdbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -2064,8 +2064,8 @@ func addInstallPanel(c *Console) error {

if c.config.Install.ManagementInterface.Method == config.NetworkMethodDHCP {
printToPanel(c.Gui, "Configuring network...", installPanel)
if _, err := applyNetworks(c.config.ManagementInterface, c.config.Hostname); err != nil {
printToPanel(c.Gui, fmt.Sprintf("can't apply networks: %s", err), installPanel)
if output, err := applyNetworks(c.config.ManagementInterface, c.config.Hostname); err != nil {
printToPanel(c.Gui, fmt.Sprintf("Can't apply networks: %s\n%s", err, string(output)), installPanel)
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/console/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func applyNetworks(network config.Network, hostname string) ([]byte, error) {
"/etc/sysconfig/network/dhcp").CombinedOutput()
if err != nil {
logrus.Error(err, string(output))
return nil, err
return output, err
}

conf := &yipSchema.YipConfig{
Expand Down Expand Up @@ -100,7 +100,7 @@ func applyNetworks(network config.Network, hostname string) ([]byte, error) {
bytes, err = cmd.CombinedOutput()
if err != nil {
logrus.Error(err, string(bytes))
return nil, err
return bytes, err
}
// Restore Down NIC to up
if err := upAllLinks(); err != nil {
Expand Down

0 comments on commit db9cdbb

Please sign in to comment.