fuel-plugin-calico/deployment_scripts/get_controller_ip.py

17 lines
336 B
Python
Executable File

#!/usr/bin/env python
# Copyright 2015 Metaswitch Networks
import yaml
with open("/etc/compute.yaml", "r") as f:
config = yaml.safe_load(f)
for node in config["nodes"]:
if node["role"] == "primary-controller":
controller_ip = node["internal_address"]
break
else:
controller_ip = None
print controller_ip