Drop a matched Host Primary Disk from the pool so it is not captured twice - #173
Merged
Merged
Conversation
…twice getHardDisk() lists the device pool one device per line, then tried to remove a matched device with a sed that only matched it with a space on each side. The pattern never matched, the device stayed in the pool, and the "add unmatched devices" step appended it again. With a multi-disk image and Host Primary Disk set, that disk was captured twice and on deploy written back twice (fogproject #743). Match whole lines instead. tests/checks/primary-disk-dedup.sh drives the function over a stubbed three-disk machine and fails on the old code. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the last open symptom in FOGProject/fogproject#743: with a multi-disk-all image and Host Primary Disk set to
/dev/sda, FOS captured/dev/sdatwice and on deploy wrote it back twice.getHardDisk()lists the device pool one device per line, then tried to remove a matched device with a sed that only matched it with a space on each side. That never matched, the device stayed in the pool, and the "add unmatched devices" step appended it again.grep -vx.tests/checks/primary-disk-dedup.shdrives the function over a stubbed three-disk machine. Against the old code it reports/dev/sda /dev/sda /dev/sdb /dev/nvme0n1; against the fix, each disk once with the named one first. Full suite: 20 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby