Skip to content

Commit

Permalink
network: fix nmcli check pattern (#472)
Browse files Browse the repository at this point in the history
Given the implementation of cliExists() we are ignoring one case
by not checking the boolean return, if should assume nmcli doesn't
exist if the boolean return is false and not the error as nil.
  • Loading branch information
dorileo authored Nov 22, 2024
1 parent 43ca38d commit 377072d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google_guest_agent/network/manager/network_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ func (n *networkManager) IsManaging(ctx context.Context, iface string) (bool, er

// Check for existence of nmcli. Without nmcli, the agent cannot tell NetworkManager
// to reload the configs for its connections.
_, err := cliExists("nmcli")
if err != nil {
exists, err := cliExists("nmcli")
if !exists {
return false, err
}

Expand Down

0 comments on commit 377072d

Please sign in to comment.