diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-10-01 14:20:35 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-10-01 14:20:35 +0000 |
commit | 2497f596be89f3f6cfb1431fba68a0a599879e40 (patch) | |
tree | 4ebfc73d15ac5af35c1eebc47d1ef47826dad151 /os_net_config/impl_ifcfg.py | |
parent | 6c460cc9fd2e710d42bd1f56a5c887e5920f55e8 (diff) | |
parent | d788652276344c8dbe5a97d629f19a66c9de97f4 (diff) |
Merge "ifcfg: Add support for dns_servers"
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r-- | os_net_config/impl_ifcfg.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 4cacbf8..81a1df4 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -157,6 +157,12 @@ class IfcfgNetConfig(os_net_config.NetConfig): data += "DEFROUTE=no\n" if base_opt.dhclient_args: data += "DHCLIENTARGS=%s\n" % base_opt.dhclient_args + if base_opt.dns_servers: + data += "DNS1=%s\n" % base_opt.dns_servers[0] + if len(base_opt.dns_servers) == 2: + data += "DNS2=%s\n" % base_opt.dns_servers[1] + elif len(base_opt.dns_servers) > 2: + logger.warning('ifcfg format supports a max of 2 dns servers.') return data def _add_routes(self, interface_name, routes=[]): |