From: Greg Brockman <gdb@mit.edu>
Date: Sun, 31 Jan 2010 23:50:32 +0000 (-0500)
Subject: Merged in r2821,2824,2827 from hvirt branch.
X-Git-Tag: 0.0.31~4
X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-xen-config.git/commitdiff_plain/ad04fac1b037458007a467667955a3a0ea0c2966?ds=inline;hp=636385dbe15d798ab686814fb75add7d96e08d2b

Merged in r2821,2824,2827 from hvirt branch.

svn path=/trunk/packages/invirt-xen-config/; revision=2972
---

diff --git a/debian/changelog b/debian/changelog
index 27ed90a..796195d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+invirt-xen-config (0.0.29) unstable; urgency=low
+
+  * Merged in r2821,2824,2827 from hvirt branch.
+
+ -- Greg Brockman <gdb@mit.edu>  Sun, 31 Jan 2010 18:44:53 -0500
+
 invirt-xen-config (0.0.28) unstable; urgency=low
 
   * Restarting xend is just a *really bad* idae.
diff --git a/debian/transform_xend-config.sxp.invirt.mako b/debian/transform_xend-config.sxp.invirt.mako
index bb31e68..90555e7 100755
--- a/debian/transform_xend-config.sxp.invirt.mako
+++ b/debian/transform_xend-config.sxp.invirt.mako
@@ -3,11 +3,21 @@ print <<'EOF';
 <%
 from invirt.config import structs as cfg
 import os
-hostname = os.uname()[1].split('.')[0]
+fqdn = os.uname()[1]
+internal_ip = None
+# This hack is necessary because cfg.hosts is an array rather than a dict.
+for host in cfg.hosts:
+  if host.hostname == fqdn:
+    internal_ip = host.internal_ip
+    break
+
+class xend_template_exception(Exception): pass
+if internal_ip is None:
+  raise xend_template_exception('Could not find an internal IP in the configuration for host %s' % fqdn)
 %>
 EOF
 
-s/^\#?\(xend-relocation-address ''\)/(xend-relocation-address '\${hostname}-internal')/m or die;
+s/^\#?\(xend-relocation-address ''\)/(xend-relocation-address '\${internal_ip}')/m or die;
 s/^\(xend-relocation-hosts-allow '[^']*'\)/(xend-relocation-hosts-allow '')/m or die;
 s/^\(dom0-min-mem [0-9]*\)/(dom0-min-mem 1536)/m or die;
 print;