Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/inventory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ inventory_sync() {

# Get actual status from Vagrant
local actual_status
actual_status=$(cd "${vm_dir}" && vagrant status --machine-readable 2>/dev/null \
actual_status=$(cd "${vm_dir}" && "${VAGRANT_CMD}" status --machine-readable 2>/dev/null \
| grep -E ',state,' | tail -1 | cut -d',' -f4)

if [[ -n "${actual_status}" ]]; then
Expand All @@ -383,7 +383,7 @@ inventory_sync() {
# Update IP if running
if [[ "${actual_status}" == "running" ]]; then
local ip
ip=$(cd "${vm_dir}" && vagrant ssh -c "hostname -I" 2>/dev/null \
ip=$(cd "${vm_dir}" && "${VAGRANT_CMD}" ssh -c "hostname -I" 2>/dev/null \
| awk '{print $1}' | tr -d '\r')
if [[ -n "${ip}" ]]; then
inventory_update "${vm_name}" "ip" "${ip}"
Expand Down
6 changes: 3 additions & 3 deletions lib/vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ ensure_vagrant_box() {
# Box registered but image missing - clean up and re-register
if [[ "${box_registered}" -eq 1 ]] && [[ "${image_exists}" -eq 0 ]]; then
log_warn "Box '${box}' registered but image file missing - cleaning up"
vagrant box remove "${box}" --force 2>/dev/null || true
"${VAGRANT_CMD}" box remove "${box}" --force 2>/dev/null || true
rm -rf "${vagrant_home}/boxes/${encoded_name}" 2>/dev/null || true
fi

Expand Down Expand Up @@ -750,7 +750,7 @@ _ensure_parrot_qcow2() {
# Box registered but qcow2 missing - clean up and re-register
if [[ "${box_registered}" -eq 1 ]] && [[ "${qcow2_exists}" -eq 0 ]]; then
log_warn "Parrot box registered but qcow2 file missing - cleaning up"
vagrant box remove "${box_name}" --force 2>/dev/null || true
"${VAGRANT_CMD}" box remove "${box_name}" --force 2>/dev/null || true
rm -rf "${vagrant_home}/boxes/${encoded_name}" 2>/dev/null || true
fi

Expand Down Expand Up @@ -1028,7 +1028,7 @@ _ensure_parrot_box() {
# Box registered but image missing - clean up and re-download
if [[ "${box_registered}" -eq 1 ]] && [[ "${image_exists}" -eq 0 ]]; then
log_warn "Parrot box registered but image file missing - cleaning up"
vagrant box remove "${box_name}" --force 2>/dev/null || true
"${VAGRANT_CMD}" box remove "${box_name}" --force 2>/dev/null || true
rm -rf "${vagrant_home}/boxes/${encoded_name}" 2>/dev/null || true
fi

Expand Down
Loading