From 3725b3ee30c075bedaaf62cde9ed3d5fc5a5bc92 Mon Sep 17 00:00:00 2001 From: Wilder Rodrigues Date: Thu, 22 Oct 2015 13:03:06 +0200 Subject: [PATCH] CLOUDSTACK-8935 - Add a check to avoid exception related to None value --- systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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():