summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2014-01-15 13:02:30 -0700
committerusd-importer <ubuntu-server@lists.ubuntu.com>2014-01-16 00:38:26 +0000
commitb10340ae4082fc4904a41f90d4b4e6d2179ef2ff (patch)
treeba7136744c67e23ec658611a1ba9f53520bb3648 /debian/patches
parent531fca58c17be1106d6d90e55315ac8ee7086435 (diff)
downloadvyos-walinuxagent-b10340ae4082fc4904a41f90d4b4e6d2179ef2ff.tar.gz
vyos-walinuxagent-b10340ae4082fc4904a41f90d4b4e6d2179ef2ff.zip
Import patches-unapplied version 1.3.2-0ubuntu8 to ubuntu/trusty-proposed
Imported using git-ubuntu import. Changelog parent: 531fca58c17be1106d6d90e55315ac8ee7086435 New changelog entries: * debian/patches/idns_dhcp.patch: only change send-hostname in dhcpclient.conf when send-hostname is already in the config (LP: #1268050).
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/idns_dhcp.patch44
-rw-r--r--debian/patches/series1
2 files changed, 45 insertions, 0 deletions
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