Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

Commit 738aa6f

Browse files
Fix check-versions CI: update Vagrant Cloud URLs and fix Vagrantfile cut delimiter
Co-authored-by: electrocucaracha <2782150+electrocucaracha@users.noreply.github.com> Agent-Logs-Url: https://github.com/electrocucaracha/lint-devstack/sessions/7b31e12b-7e74-4978-af45-9aea5894c7bb
1 parent eb295d0 commit 738aa6f

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public_nic = `ip r get 1.1.1.1 | head -n 1 | cut -d ' ' -f 5`.strip! || "eth0"
3737
public_cidr = `ip r | grep "dev $(ip r get 1.1.1.1 | head -n 1 | cut -d ' ' -f 5) .* scope link" | cut -d ' ' -f 1`.strip! || "192.168.0.0/24"
3838
public_gw = `ip r | grep "^default" | head -n 1 | cut -d ' ' -f 3`.strip! || "192.168.0.1"
3939
*prefix, _ = public_gw.split(".")
40-
vb_public_nic = `VBoxManage list bridgedifs | grep "^Name:.*#{public_nic}" | cut -d "Name:[ ]*" -f 2`.strip! if which "VBoxManage"
40+
vb_public_nic = `VBoxManage list bridgedifs | grep "^Name:.*#{public_nic}" | awk '{$1=""; sub(/^[[:space:]]+/, ""); print}'`.strip! if which "VBoxManage"
4141

4242
qemu_version = ""
4343
qemu_version = `qemu-system-x86_64 --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/'` if which "qemu-system-x86_64"

ci/update_distros.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ function _get_box_current_version {
2727
version=$(grep "^${name} .*$PROVIDER" ./ci/pinned_vagrant_boxes.txt | awk '{ print $2 }')
2828
else
2929
until [ "$version" ]; do
30-
metadata="$(curl -s "https://app.vagrantup.com/api/v1/box/$name")"
30+
metadata="$(curl -s "https://vagrantcloud.com/api/v2/vagrant/${name%/*}/${name#*/}")"
3131
if [ "$metadata" ]; then
32-
version="$(echo "$metadata" | python -c 'import json,sys;print(json.load(sys.stdin)["current_version"]["version"])')"
32+
version="$(echo "$metadata" | python3 -c 'import json,sys;print(json.load(sys.stdin)["current_version"]["version"])')"
3333
break
3434
elif [ ${attempt_counter} -eq ${max_attempts} ]; then
3535
echo "Max attempts reached"
@@ -43,13 +43,23 @@ function _get_box_current_version {
4343
echo "${version#*v}"
4444
}
4545

46+
function _get_box_arch {
47+
case "$(uname -m)" in
48+
x86_64) echo "amd64" ;;
49+
aarch64) echo "arm64" ;;
50+
*) uname -m ;;
51+
esac
52+
}
53+
4654
function _vagrant_pull {
4755
local alias="$1"
4856
local name="$2"
57+
local arch
4958

5059
version=$(_get_box_current_version "$name")
60+
arch=$(_get_box_arch)
5161

52-
if [ "$(curl "https://app.vagrantup.com/${name%/*}/boxes/${name#*/}/versions/$version/providers/$PROVIDER.box" -o /dev/null -w '%{http_code}\n' -s)" == "302" ] && [ "$(vagrant box list | grep -c "$name .*$PROVIDER, $version")" != "1" ]; then
62+
if [ "$(curl "https://vagrantcloud.com/${name%/*}/boxes/${name#*/}/versions/$version/providers/$PROVIDER/$arch/vagrant.box" -o /dev/null -w '%{http_code}\n' -s)" == "302" ] && [ "$(vagrant box list | grep -c "$name .*$PROVIDER, $version")" != "1" ]; then
5363
vagrant box remove --provider "$PROVIDER" --all --force "$name" || :
5464
vagrant box add --provider "$PROVIDER" --box-version "$version" "$name"
5565
elif [ "$(vagrant box list | grep -c "$name .*$PROVIDER, $version")" == "1" ]; then

0 commit comments

Comments
 (0)