Don't fork a templater process, use the library 57/21957/1
authorPeter Barabas <peter.barabas@ericsson.com>
Tue, 6 Sep 2016 11:23:35 +0000 (13:23 +0200)
committerJonas Bjurel <jonas.bjurel@ericsson.com>
Tue, 20 Sep 2016 21:03:10 +0000 (21:03 +0000)
Change-Id: I931ba56fe65f2f5d5af483a8bfe654a0ecda1611
Signed-off-by: Peter Barabas <peter.barabas@ericsson.com>
(cherry picked from commit ff26503f13676b7551afc0633621786edd2811f0)

deploy/reap.py

index eb02fe2..69c98d1 100644 (file)
@@ -18,6 +18,7 @@ import shutil
 import tempfile
 import re
 import netaddr
+import templater
 
 from common import (
     N,
@@ -79,8 +80,6 @@ DHA_2 = '''
 # which may not be correct - please adjust as needed.
 '''
 
-TEMPLATER = 'templater.py'
-
 DISKS = {'fuel': '100G',
          'controller': '100G',
          'compute': '100G'}
@@ -353,8 +352,10 @@ class Reap(object):
         self.download_config('network')
 
     def create_base_dea(self):
-        exec_cmd('python %s %s %s %s'
-                 % (TEMPLATER, self.dea_file, self.template, self.base_dea))
+        templater = templater.Templater(self.dea_file,
+                                        self.template,
+                                        self.base_dea)
+        templater.run()
 
     def finale(self):
         log('DEA file is available at %s' % self.dea_file)