#!/usr/bin/env bash
# fake juju for behavior-testing phase-02-vault-preflight.sh
sub="${1:-}"
case "$sub" in
  whoami)
    echo "Controller:  juju-controller"
    echo "Model:       ${FAKE_MODEL:-openstack}"
    echo "User:        jessea123" ;;
  models)
    printf '{"models":[{"name":"admin/%s"}]}\n' "${FAKE_MODEL:-openstack}" ;;
  status)
    cat "${FIXTURE:?FIXTURE env not set}" ;;
  *)
    echo "fake juju: unhandled subcommand: $sub" >&2; exit 1 ;;
esac
