generate config files using mako sipb-xen-console-server/2.06
authorYang Zhang <y_z@mit.edu>
Thu, 14 Aug 2008 19:15:38 +0000 (15:15 -0400)
committerYang Zhang <y_z@mit.edu>
Thu, 14 Aug 2008 19:15:38 +0000 (15:15 -0400)
svn path=/trunk/packages/sipb-xen-console-server/; revision=889

debian/changelog
debian/sipb-xen-console-server.init
files/etc/conserver/invirt-genconfig.cf.mako [new file with mode: 0644]

index 760d0e3..4819606 100644 (file)
@@ -1,3 +1,9 @@
+sipb-xen-console-server (2.06) unstable; urgency=low
+
+  * generate config files using mako
+
+ -- Yang Zhang <y_z@mit.edu>  Thu, 14 Aug 2008 15:15:18 -0400
+
 sipb-xen-console-server (2.05) unstable; urgency=low
 
   * use invirt.config rather than /etc/invirt/* directly
index 97eac71..2b8a116 100755 (executable)
@@ -31,14 +31,9 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 gen_config()
 {
-        console_ip=$(invirt-getconf console.ip)
-        cat >/etc/conserver/invirt-genconfig.cf <<EOF
-access * {
-       trusted 127.0.0.1;
-       trusted $console_ip;
-       limited *;
-}
-EOF
+        for i in /etc/conserver/invirt-genconfig.cf
+        do mako-render $i.mako > $i
+        done
 }
 
 #
diff --git a/files/etc/conserver/invirt-genconfig.cf.mako b/files/etc/conserver/invirt-genconfig.cf.mako
new file mode 100644 (file)
index 0000000..94c3f94
--- /dev/null
@@ -0,0 +1,6 @@
+<% from invirt.config import structs as cfg %>\
+access * {
+       trusted 127.0.0.1;
+       trusted ${cfg.console.ip};
+       limited *;
+}