Skip to content

fix: use connection UUID in bridge slave setup in NetworkManager#7562

Merged
Obihoernchen merged 1 commit into
xcat2:masterfrom
VersatusHPC:fix/nicutils-bridge-quoting
May 7, 2026
Merged

fix: use connection UUID in bridge slave setup in NetworkManager#7562
Obihoernchen merged 1 commit into
xcat2:masterfrom
VersatusHPC:fix/nicutils-bridge-quoting

Conversation

@viniciusferrao
Copy link
Copy Markdown
Member

This PR fixes the behaviour that NetworkManager can auto-generate connection names with spaces (e.g. "Wired connection 2"). The bridge slave setup in create_bridge_interface_nmcli stored this name in a variable that was later expanded unquoted in nmcli commands, breaking both the initial con mod and all downstream operations. The right way here is to use UUIDs, because they are unique and easier to work with.

This is probably a broader issue, however we will fix scoped this time.

Closes: #7483

… profile names

NetworkManager can auto-generate connection names with spaces (e.g.
"Wired connection 2"). The bridge slave setup in create_bridge_interface_nmcli
stored this name in a variable that was later expanded unquoted in nmcli
commands, breaking both the initial con mod and all downstream operations
(con up, con delete on rollback). Resolve the connection to its UUID
before use, which is space-safe and valid for all nmcli operations.

Closes: xcat2#7483
@Obihoernchen Obihoernchen added this to the 2.18 milestone May 7, 2026
@Obihoernchen Obihoernchen merged commit 155e58e into xcat2:master May 7, 2026
2 checks passed
viniciusferrao added a commit to VersatusHPC/xcat-core that referenced this pull request May 7, 2026
NetworkManager auto-generates connection names that can contain spaces
(e.g. "Wired connection 2"). Multiple devices can also share the same
auto-generated name. Both cases cause failures when names are passed
to nmcli in bridge and bond setup paths.

Resolve active connection UUID via nmcli device show (GENERAL.CON-UUID)
instead of by name, which avoids both word-splitting on spaces and
ambiguity when multiple connections share the same name.

Changes:
- Bridge slave setup: resolve UUID via device show instead of by name
- Bond slave setup: same UUID-via-device approach for con down/mod
- Bridge rollback: preserve original xcat-prefixed connection name so
  rollback paths restore the correct name instead of a UUID
- Utility functions: quote connection name arguments in
  is_nmcli_connection_exist, is_connection_activate_intime, and
  wait_nic_connect_intime for defensive correctness
- Add -F flag to grep in is_nmcli_connection_exist for literal matching
- Log both human-readable name and UUID when reusing existing connections

Tested on EL10 host with duplicate "Ethernet connection 1/2" profiles
across multiple NICs — UUID resolution via device returns exactly one
UUID per device regardless of name collisions.

Follows up on xcat2#7562 and xcat2#7483.
viniciusferrao added a commit to VersatusHPC/xcat-core that referenced this pull request May 7, 2026
NetworkManager auto-generates connection names that can contain spaces
(e.g. "Wired connection 2"). Multiple devices can also share the same
auto-generated name. Both cases cause failures when names are passed
to nmcli in bridge and bond setup paths.

Resolve active connection UUID via nmcli device show (GENERAL.CON-UUID)
instead of by name, which avoids both word-splitting on spaces and
ambiguity when multiple connections share the same name.

Changes:
- Bridge slave setup: resolve UUID via device show instead of by name
- Bond slave setup: same UUID-via-device approach for con down/mod
- Bridge rollback: preserve original xcat-prefixed connection name so
  rollback paths restore the correct name instead of a UUID
- Utility functions: quote connection name arguments in
  is_nmcli_connection_exist, is_connection_activate_intime, and
  wait_nic_connect_intime for defensive correctness
- Add -F flag to grep in is_nmcli_connection_exist for literal matching
- Log both human-readable name and UUID when reusing existing connections

Tested on EL10 host with duplicate "Ethernet connection 1/2" profiles
across multiple NICs — UUID resolution via device returns exactly one
UUID per device regardless of name collisions.

Follows up on xcat2#7562 and xcat2#7483.

Co-authored-by: OliverTUBAF <86062666+OliverTUBAF@users.noreply.github.com>
@viniciusferrao viniciusferrao deleted the fix/nicutils-bridge-quoting branch May 7, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

confignetwork / nicutils.sh ends with error if connection name contains white space

2 participants