#!/bin/bash

# @file load_from_chronos_cluster
#
# 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

local_site_name=site1
etcd_key=clearwater
. /etc/clearwater/config

if [ $# -ne 1 ]
then
  echo "Usage: load_from_chronos_cluster [node_type]"
  exit 1
fi

node_type=$1

/usr/share/clearwater/clearwater-cluster-manager/env/bin/python /usr/share/clearwater/clearwater-cluster-manager/scripts/load_from_chronos_cluster.py "${management_local_ip:-$local_ip}" "$local_site_name" "$node_type" "$etcd_key"
