Skip to content

Commit e6ef470

Browse files
committed
Give VM a chance to reject old backup-utils versions
This is a bit of a hack but lets new versions of the VM reject backup-utils restores if the version is too old. I'd like to move this into the ghe-host-check negotiation but we need this for current versions of backup-utils.
1 parent 12f5638 commit e6ef470

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

share/github-backup-utils/ghe-maintenance-mode-enable

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fi
4444

4545
# SSH to the appliance and run the remote maintenance mode enable command
4646
echo "Enabling maintenance mode on $host ..."
47-
ghe-ssh "$host" -- "ghe-maintenance -s"
47+
ghe-ssh "$host" -- "/usr/bin/env GHEBUVER=2 ghe-maintenance -s"
4848

4949
# Bail out early if --no-wait was given.
5050
$wait_procs || exit 0

share/github-backup-utils/ghe-restore-settings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
2828
# work around issue importing settings with bad storage mode values
2929
cat "$GHE_RESTORE_SNAPSHOT_PATH/settings.json" |
3030
sed 's/"storage_mode": "device"/"storage_mode": "rootfs"/' |
31-
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-settings' 1>&3
31+
ghe-ssh "$GHE_HOSTNAME" -- '/usr/bin/env GHEBUVER=2 ghe-import-settings' 1>&3
3232
else
3333
cat "$GHE_RESTORE_SNAPSHOT_PATH/settings.json" |
34-
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-settings' 1>&3
34+
ghe-ssh "$GHE_HOSTNAME" -- '/usr/bin/env GHEBUVER=2 ghe-import-settings' 1>&3
3535
fi
3636

3737
# Bail out if we're restoring against a pre-2.x appliance. Everything below is

0 commit comments

Comments
 (0)