You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix shellcheck SC2086 and auto-discover hypervisor from inventory
- Convert SSH_OPTS from string to bash array, expand with "${SSH_OPTS[@]}"
- Auto-discover hypervisor from TNT inventory (deploy/openshift-clusters/inventory.ini)
with explicit argument as override
- Add pre-flight check for dev-scripts on the hypervisor
- Make missing config file non-fatal (Patch 0 skips gracefully)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: helpers/README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,12 +132,11 @@ ansible all -i deploy/openshift-clusters/inventory.ini -m shell -a "./fencing_va
132
132
133
133
Patches dev-scripts on a hypervisor to generate `macaddress:`-based fencing credentials instead of `hostname:`-based ones in the ABI install-config. Used for verifying [OCPEDGE-2692](https://issues.redhat.com/browse/OCPEDGE-2692) (MAC address fencing credential support in assisted-service).
134
134
135
-
**What it patches** (3 files under `dev-scripts/agent/`):
136
-
1.`05_agent_configure.sh` — collects master MAC addresses into `AGENT_MASTER_MACS_STR`
The hypervisor is auto-discovered from `deploy/openshift-clusters/inventory.ini` (the `[metal_machine]` group). An explicit argument overrides auto-discovery.
160
+
157
161
**Important:** TNT's Ansible role runs `git checkout --force` on dev-scripts before every deployment, wiping these patches. Either run this script after TNT's git checkout (before `make agent`), or deploy directly on the hypervisor.
HYPERVISOR=$(awk '/^\[metal_machine\]/{found=1; next} found && /^[[:space:]]*$/{next} found && /^#/{next} found && /^\[/{exit} found{print $1; exit}'"${INVENTORY}")
38
+
if [[ -z"${HYPERVISOR}" ]];then
39
+
echo"ERROR: Could not parse hypervisor from ${INVENTORY}"
40
+
exit 1
41
+
fi
42
+
echo"Auto-discovered hypervisor from inventory: ${HYPERVISOR}"
43
+
else
44
+
echo"ERROR: No hypervisor specified and inventory not found at ${INVENTORY}"
0 commit comments