Skip to content

Commit 377072d

Browse files
authored
network: fix nmcli check pattern (#472)
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.
1 parent 43ca38d commit 377072d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

google_guest_agent/network/manager/network_manager_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ func (n *networkManager) IsManaging(ctx context.Context, iface string) (bool, er
143143

144144
// Check for existence of nmcli. Without nmcli, the agent cannot tell NetworkManager
145145
// to reload the configs for its connections.
146-
_, err := cliExists("nmcli")
147-
if err != nil {
146+
exists, err := cliExists("nmcli")
147+
if !exists {
148148
return false, err
149149
}
150150

0 commit comments

Comments
 (0)