diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py index 02e7bd74834..6200d482d9c 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py @@ -69,9 +69,10 @@ class CsDhcp(CsDataBag): line = "dhcp-option=tag:interface-%s,15,%s" % (device, gn.get_domain()) self.conf.search(sline, line) # DNS search order - sline = "dhcp-option=tag:interface-%s,6" % device - line = "dhcp-option=tag:interface-%s,6,%s" % (device, ','.join(gn.get_dns())) - self.conf.search(sline, line) + if gn.get_dns() and device: + sline = "dhcp-option=tag:interface-%s,6" % device + line = "dhcp-option=tag:interface-%s,6,%s" % (device, ','.join(gn.get_dns())) + self.conf.search(sline, line) # Gateway gateway = '' if self.config.is_vpc():