Permalink
Browse files

Fix RHEL injector code removing unknown global g.

Add DNS injection to ifcfg-ethN.
  • Loading branch information...
1 parent bf1c845 commit 955b1d8ca878b9561125b9846b2faf593f71b8c5 Andy Lerner committed Jan 11, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −1 nova/virt/injector.py
  2. +3 −0 nova/virt/netcfg.py
@@ -132,7 +132,7 @@ def __init__(self, image):
def get_os_type(self):
if self.__os_type is None:
- self.__os_type = g.inspect_get_distro(self.__root)
+ self.__os_type = self.__gfs.inspect_get_distro(self.__root)
return self.__os_type
def __find_root(self):
View
@@ -81,6 +81,9 @@ def __init__(self):
def generate(self, nets):
for net in nets:
cfg = [self.__header, self.__iface4.format(**net)]
+ dnslist=net['dns'].split()
+ for idx in range(len(dnslist)):
+ cfg.append('DNS{0}={1}\n'.format(idx+1, dnslist[idx]))
if FLAGS.use_ipv6:
cfg.append(self.__iface6.format(**net))
yield ('/etc/sysconfig/network-scripts/ifcfg-{0}'.format(net['name']), ''.join(cfg))

0 comments on commit 955b1d8

Please sign in to comment.