From 6b2a5cb4a524b9059e25fe7ec1989030c456261c Mon Sep 17 00:00:00 2001 From: "Stephen A. Zarkos" Date: Wed, 29 Jul 2015 19:05:03 +0000 Subject: [PATCH] Fix error with applying azure/assets/udev.diff When creating an image for Azure we see the following error when applying udev.diff: TypeError: cannot concatenate 'str' and 'file' objects Resolving this in log_call() I still see the following error: patch: **** Only garbage was found in the patch input. So fixing this in providers/azure/tasks/boot.py seems to be the best route. --- bootstrapvz/providers/azure/tasks/boot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrapvz/providers/azure/tasks/boot.py b/bootstrapvz/providers/azure/tasks/boot.py index 1ec9f56..d7d4d5f 100644 --- a/bootstrapvz/providers/azure/tasks/boot.py +++ b/bootstrapvz/providers/azure/tasks/boot.py @@ -15,9 +15,9 @@ class PatchUdev(Task): from bootstrapvz.common.tools import log_check_call from . import assets # c.f. http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/commit/?id=61e055638cea - with open(os.path.join(assets, 'udev.diff')) as diff_file: - udev_dir = os.path.join(info.root, 'usr/share/initramfs-tools/scripts/init-top') - log_check_call(['patch', '--no-backup-if-mismatch', '-p6', '-d' + udev_dir], stdin=diff_file) + diff_file = file.read(open(os.path.join(assets, 'udev.diff'), 'r')) + udev_dir = os.path.join(info.root, 'usr/share/initramfs-tools/scripts/init-top') + log_check_call(['patch', '--no-backup-if-mismatch', '-p6', '-d' + udev_dir], stdin=diff_file) class ConfigureGrub(Task):