From 9932e785db8e1a4131db6a4121a2c47e7c6f5f1c Mon Sep 17 00:00:00 2001 From: Vitaly Parakhin Date: Thu, 28 May 2015 14:07:56 +0300 Subject: [PATCH] Fix incorrect Fuel config source --- config/fuel.cfg | 4 ++-- util/parse_yaml.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config/fuel.cfg b/config/fuel.cfg index 6a78f40..a65b4c9 100644 --- a/config/fuel.cfg +++ b/config/fuel.cfg @@ -19,8 +19,8 @@ else DOCKER_MODE=true # autodetect Fuel settings -source <( $BINROOT/util/parse_yaml.py /etc/fuel/astute.yaml "FUEL" ) -source <( $BINROOT/util/parse_yaml.py /etc/nailgun/version.yaml "FUEL" ) +source <( dockerctl shell astute cat /etc/fuel/astute.yaml | $BINROOT/util/parse_yaml.py "FUEL" ) +source <( dockerctl shell nailgun cat /etc/nailgun/version.yaml | $BINROOT/util/parse_yaml.py "FUEL" ) FUEL_VERSION=$FUEL_VERSION_release FUEL_SERVER=$FUEL_ADMIN_NETWORK_ipaddress FULL_RELEASE=$FUEL_VERSION_openstack_version diff --git a/util/parse_yaml.py b/util/parse_yaml.py index 42235dd..75f6bca 100755 --- a/util/parse_yaml.py +++ b/util/parse_yaml.py @@ -1,12 +1,11 @@ #!/usr/bin/python -# Enumerate YAML file and produce prefixed output +# Enumerate YAML from stdin and produce prefixed output import re import sys import yaml -filename = sys.argv[1] -prefix = sys.argv[2] +prefix = sys.argv[1] def serialize(value, name): if value is None: @@ -22,6 +21,6 @@ def serialize(value, name): else: print('{0}="{1}"'.format(name, value)) -with open(filename, 'r') as yaml_file: +with sys.stdin as yaml_file: data = yaml.load(yaml_file) serialize(data, prefix)