projects
/
invirt/packages/invirt-console.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed dependence on REMOTE_HOST env variable and reverse DNS.
[invirt/packages/invirt-console.git]
/
server
/
usr
/
sbin
/
invirt-console-update
diff --git
a/server/usr/sbin/invirt-console-update
b/server/usr/sbin/invirt-console-update
index
e24a3ce
..
8da9bfb
100755
(executable)
--- a/
server/usr/sbin/invirt-console-update
+++ b/
server/usr/sbin/invirt-console-update
@@
-3,9
+3,15
@@
import sys
import os
import subprocess
import os
import subprocess
+from invirt.config import structs as config
+
def main(args):
contents = args[2]
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()
f = file('/etc/conserver/conf.d/'+hostname, 'w')
f.write(contents)
f.close()