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()