From fcf8e6f1af68797e4a54efb22a47095fc4e3bedf Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Thu, 31 Mar 2016 16:29:20 -0400 Subject: Yedit enhancements --- roles/lib_yaml_editor/build/generate.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'roles/lib_yaml_editor/build/generate.py') diff --git a/roles/lib_yaml_editor/build/generate.py b/roles/lib_yaml_editor/build/generate.py index 0df4efb92..312e4d0ee 100755 --- a/roles/lib_yaml_editor/build/generate.py +++ b/roles/lib_yaml_editor/build/generate.py @@ -15,19 +15,20 @@ GEN_STR = "#!/usr/bin/env python\n" + \ "# | |) | (_) | | .` | (_) || | | _|| |) | | | |\n" + \ "# |___/ \___/ |_|\_|\___/ |_| |___|___/___| |_|\n" +OPENSHIFT_ANSIBLE_PATH = os.path.dirname(os.path.realpath(__file__)) + FILES = {'yedit.py': ['src/base.py', 'src/yedit.py', 'ansible/yedit.py'], } - def main(): ''' combine the necessary files to create the ansible module ''' - openshift_ansible = ('../library/') + library = os.path.join(OPENSHIFT_ANSIBLE_PATH, '..', 'library/') for fname, parts in FILES.items(): - with open(os.path.join(openshift_ansible, fname), 'w') as afd: + with open(os.path.join(library, fname), 'w') as afd: afd.seek(0) afd.write(GEN_STR) for fpart in parts: - with open(fpart) as pfd: + with open(os.path.join(OPENSHIFT_ANSIBLE_PATH, fpart)) as pfd: # first line is pylint disable so skip it for idx, line in enumerate(pfd): if idx == 0 and 'skip-file' in line: -- cgit v1.2.3