# -*- coding: utf-8 -*-

# project
import yaml

ens_client_config = "/usr/local/easyops/ens_client/conf/client.yaml"

with open(ens_client_config, 'r') as fp:
    client_config = yaml.load(fp)

parent_nodes = []
parent_config = []
plugin_config = client_config['plugins']

for each_plugin in plugin_config:
    if each_plugin['name'] == 'ens_client':
        parent_config = each_plugin
        break

for each_parent in parent_config['config']['parent']:
    parent_nodes.append(each_parent['ip'])

print ' '.join(parent_nodes)

