From 0320cdd4c78e65d5c5f8afe08cf9957d1f433c69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= <cedric.dsm@tiolive.com>
Date: Tue, 18 Sep 2012 18:03:33 +0200
Subject: [PATCH] Add support for instance.cfg instance profiles

Was named: template.cfg
---
 slapos/grid/SlapObject.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/slapos/grid/SlapObject.py b/slapos/grid/SlapObject.py
index 9704f0682..51417ad33 100644
--- a/slapos/grid/SlapObject.py
+++ b/slapos/grid/SlapObject.py
@@ -285,7 +285,10 @@ class Partition(object):
     os.environ = utils.getCleanEnvironment(pwd.getpwuid(
       instance_stat_info.st_uid).pw_dir)
     # Generates buildout part from template
-    template_location = os.path.join(self.software_path, 'template.cfg')
+    template_location = os.path.join(self.software_path, 'instance.cfg')
+    # Backward compatibility: "instance.cfg" file was named "template.cfg".
+    if not os.path.exists(template_location):
+      template_location = os.path.join(self.software_path, 'template.cfg')
     config_location = os.path.join(self.instance_path, 'buildout.cfg')
     self.logger.debug("Copying %r to %r" % (template_location, config_location))
     try:
-- 
2.30.9