From: Peter Iannucci Date: Sat, 29 Jun 2013 23:28:29 +0000 (-0400) Subject: Removed dependence on REMOTE_HOST env variable and reverse DNS. X-Git-Tag: 0.2.17^2 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-console.git/commitdiff_plain/refs/heads/iannucci Removed dependence on REMOTE_HOST env variable and reverse DNS. --- diff --git a/debian/changelog b/debian/changelog index b2f91b4..9836e76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-console (0.2.16) unstable; urgency=low + + * invirt-console-update now doesn't depend on remctld setting REMOTE_HOST + + -- Peter Iannucci Mon, 01 Jul 2013 21:22:00 -0400 + invirt-console (0.2.15) unstable; urgency=low * Divert /etc/conserver/console.cf in the right binary package. diff --git a/server/usr/sbin/invirt-console-update b/server/usr/sbin/invirt-console-update index e24a3ce..8da9bfb 100755 --- a/server/usr/sbin/invirt-console-update +++ b/server/usr/sbin/invirt-console-update @@ -3,9 +3,15 @@ import sys import os import subprocess +from invirt.config import structs as config + def main(args): contents = args[2] - hostname = os.environ['REMOTE_HOST'].lower() + host_addr = os.environ['REMOTE_ADDR'] + for h in config.hosts: + if host_addr in h.internal_ips or host_addr == h.ip: + hostname = h.hostname + break f = file('/etc/conserver/conf.d/'+hostname, 'w') f.write(contents) f.close()