Index: trunk/packages/sipb-xen-console/debian/changelog
===================================================================
--- trunk/packages/sipb-xen-console/debian/changelog	(revision 887)
+++ trunk/packages/sipb-xen-console/debian/changelog	(revision 888)
@@ -1,2 +1,8 @@
+sipb-xen-console (7.8) unstable; urgency=low
+
+  * generate config files using mako
+
+ -- Yang Zhang <y_z@mit.edu>  Thu, 14 Aug 2008 15:10:50 -0400
+
 sipb-xen-console (7.7) unstable; urgency=low
 
Index: trunk/packages/sipb-xen-console/debian/sipb-xen-console.init
===================================================================
--- trunk/packages/sipb-xen-console/debian/sipb-xen-console.init	(revision 887)
+++ trunk/packages/sipb-xen-console/debian/sipb-xen-console.init	(revision 888)
@@ -38,25 +38,11 @@
 gen_config()
 {
-    {
-        for i in $(invirt-getconf --ls hosts); do
-            local hostname=$(invirt-getconf hosts.$i.hostname)
-            echo "#include /etc/conserver/conf.d/$hostname"
-        done
-    } > /etc/conserver/invirt-hosts.cf
-    local realm=$(invirt-getconf authn.0.realm)
-    {
-        for i in $(invirt-getconf --ls hosts); do
-            local hostname=$(invirt-getconf hosts.$i.hostname)
-            echo "host/$hostname@$realm"
-        done
-    } > /etc/remctl/acl/invirt-console
-
-    mako-render /etc/nss-pgsql.conf.mako > /etc/nss-pgsql.conf
-
-    fmt > /etc/issue.net.no_tkt << EOF
-You must login to the $(invirt-getconf console.hostname) console server using
-Kerberos tickets, but your ssh client did not pass a valid ticket to the
-console server.
-EOF
+    for i in /etc/conserver/invirt-hosts.cf \
+             /etc/remctl/acl/invirt-console \
+             /etc/issue.net.no_tkt \
+             /etc/nss-pgsql.conf \
+             ; do
+        mako-render $i.mako > $i
+    done
 }
 
Index: trunk/packages/sipb-xen-console/files/etc/conserver/invirt-hosts.cf.mako
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/conserver/invirt-hosts.cf.mako	(revision 888)
+++ trunk/packages/sipb-xen-console/files/etc/conserver/invirt-hosts.cf.mako	(revision 888)
@@ -0,0 +1,4 @@
+<% from invirt.config import structs as cfg %>\
+% for h in cfg.hosts:
+#include /etc/conserver/conf.d/${h.hostname}
+% endfor
Index: trunk/packages/sipb-xen-console/files/etc/issue.net.no_tkt.mako
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/issue.net.no_tkt.mako	(revision 888)
+++ trunk/packages/sipb-xen-console/files/etc/issue.net.no_tkt.mako	(revision 888)
@@ -0,0 +1,4 @@
+<% from invirt.config import structs as cfg %>\
+You must login to the ${cfg.console.hostname} console server using
+Kerberos tickets, but your ssh client did not pass a valid ticket to the
+console server.
Index: trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console	(revision 887)
+++ trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console	(revision 888)
@@ -0,0 +1,4 @@
+<% from invirt.config import structs as cfg %>\
+% for h in cfg.hosts:
+host/${h.hostname}@${cfg.authn[0].realm}
+% endfor
