summaryrefslogtreecommitdiffstats
path: root/roles/lib_yaml_editor/build/generate.py
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2016-03-31 16:29:20 -0400
committerKenny Woodson <kwoodson@redhat.com>2016-04-04 12:27:37 -0400
commitfcf8e6f1af68797e4a54efb22a47095fc4e3bedf (patch)
tree4339ee6a75490cf5cba20a278545d9932a2b0bab /roles/lib_yaml_editor/build/generate.py
parent9451e288a77ed09cad19ef4fe27479f5b808277f (diff)
downloadopenshift-fcf8e6f1af68797e4a54efb22a47095fc4e3bedf.tar.gz
openshift-fcf8e6f1af68797e4a54efb22a47095fc4e3bedf.tar.bz2
openshift-fcf8e6f1af68797e4a54efb22a47095fc4e3bedf.tar.xz
openshift-fcf8e6f1af68797e4a54efb22a47095fc4e3bedf.zip
Yedit enhancements
Diffstat (limited to 'roles/lib_yaml_editor/build/generate.py')
-rwxr-xr-xroles/lib_yaml_editor/build/generate.py9
1 files changed, 5 insertions, 4 deletions
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: