#!/bin/bash

# Copyright (C) Metaswitch Networks 2015
# If license terms are provided to you in a COPYING file in the root directory
# of the source code repository by which you are accessing this code, then
# the license outlined in that COPYING file applies to your use.
# Otherwise no rights are granted except for those provided to you by
# Metaswitch Networks in a separate written agreement.

set -ue

. /etc/clearwater/config

if [ $# -ne 2 ]
then
  echo "Usage: force_etcd_state [etcd_key] [json_file]"
  exit 1
fi

key=$1
json_file=$2

/usr/share/clearwater/clearwater-cluster-manager/env/bin/python /usr/share/clearwater/clearwater-cluster-manager/scripts/force_etcd_state.py ${management_local_ip:-$local_ip} $key $json_file
