Skip to content

When cleaning up NetworkManager network configuration files, use os.Remove instead of os.RemoveAll - #367

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_922209917
Jul 28, 2026
Merged

When cleaning up NetworkManager network configuration files, use os.Remove instead of os.RemoveAll#367
copybara-service[bot] merged 1 commit into
mainfrom
test_922209917

Conversation

@copybara-service

@copybara-service copybara-service Bot commented May 27, 2026

Copy link
Copy Markdown

When cleaning up NetworkManager network configuration files, use os.Remove instead of os.RemoveAll

If NetworkManager is the primary network manager, and manage_primary_nic is set to false, with the current logic, the guest agent will always think it's removed the primary NIC config due to os.RemoveAll always returning nil when the file doesn't exist. This means that the following logic depending on the os.ErrNotExist error is always hit regardless of whether the file actually existed.

@copybara-service
copybara-service Bot force-pushed the test_922209917 branch 2 times, most recently from c2548ed to 95be855 Compare July 28, 2026 17:40
…s.Remove` instead of `os.RemoveAll`

If `NetworkManager` is the primary network manager, and `manage_primary_nic` is set to false, with the current logic, the guest agent will always think it's removed the primary NIC config due to `os.RemoveAll` always returning `nil` when the file doesn't exist. This means that the following logic depending on the `os.ErrNotExist` error is always hit regardless of whether the file actually existed.

PiperOrigin-RevId: 955345364
@copybara-service
copybara-service Bot merged commit 0cf1795 into main Jul 28, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_922209917 branch July 28, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant