summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog8
-rw-r--r--debian/patches/idns_dhcp.patch44
-rw-r--r--debian/patches/series1
3 files changed, 53 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 290a7db..bebdfbb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+walinuxagent (1.3.2-0ubuntu8) trusty; urgency=low
+
+ * debian/patches/idns_dhcp.patch: only change send-hostname in
+ dhcpclient.conf when send-hostname is already in the config
+ (LP: #1268050).
+
+ -- Ben Howard <ben.howard@ubuntu.com> Wed, 15 Jan 2014 13:02:30 -0700
+
walinuxagent (1.3.2-0ubuntu7) trusty; urgency=low
* debian/rules: Update for new upstream location.
diff --git a/debian/patches/idns_dhcp.patch b/debian/patches/idns_dhcp.patch
new file mode 100644
index 0000000..8db58c1
--- /dev/null
+++ b/debian/patches/idns_dhcp.patch
@@ -0,0 +1,44 @@
+Description: Don't send hostname in dhcp
+ On cloud-init provisioned hosts, the hostname is not put in
+ the dhcp client configuration. If a person runs '--deprovision', takes a
+ snapshot and attempts to start the snapshot, the host will fail to
+ register itself with iDNS.
+ .
+ Cherry picked fix from upstream
+ https://github.com/WindowsAzure/WALinuxAgent/commit/375f1ede38fd323c2560e7e21ba99ac50bc66acd
+Bug: https://bugs.launchpad.net/ubuntu/+bug/1268050
+Author: Ben Howard
+Last-Update: 2013-09-26
+--- a/waagent
++++ b/waagent
+@@ -211,6 +211,21 @@
+ return line
+ return None
+
++def FindStringInFile(fname,matchs):
++ """
++ Return match object if found in file.
++ """
++ try:
++ ms=re.compile(matchs)
++ for l in (open(fname,'r')).readlines():
++ m=re.search(ms,l)
++ if m:
++ return m
++ except:
++ raise
++
++ return None
++
+ def Run(cmd,chk_err=True):
+ retcode,out=RunGetOutput(cmd,chk_err)
+ return retcode
+@@ -1435,7 +1450,7 @@
+ SetFileContents("/etc/hostname", name)
+
+ for filepath in EtcDhcpClientConfFiles:
+- if os.path.isfile(filepath):
++ if os.path.isfile(filepath) and FindStringInFile(filepath,r'^[^#]*?send\s*host-name.*?(<hostname>|gethostname[(,)])') == None :
+ ReplaceFileContentsAtomic(filepath, "send host-name \"" + name + "\";\n"
+ + "\n".join(filter(lambda a: not a.startswith("send host-name"), GetFileContents(filepath).split('\n'))))
+
diff --git a/debian/patches/series b/debian/patches/series
index 25d7a66..7bed91d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ config_for_cloud-init.patch
verbose_logging.patch
shadow_permissions.patch
disable_disk_formating.patch
+idns_dhcp.patch