From 433cbf2ae4648fd8411ea587f9fd7e2985911d30 Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Wed, 13 Jan 2016 18:50:41 +0000 Subject: [PATCH] Only sed in growpart workaround when release is >= jessie This script is only needed/created on jessie or later distros. Signed-off-by: Andrew Garrett --- bootstrapvz/common/tasks/initd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrapvz/common/tasks/initd.py b/bootstrapvz/common/tasks/initd.py index 43bf67d..f4537e3 100644 --- a/bootstrapvz/common/tasks/initd.py +++ b/bootstrapvz/common/tasks/initd.py @@ -58,6 +58,7 @@ class AdjustExpandRootScript(Task): @classmethod def run(cls, info): from ..tools import sed_i + from bootstrapvz.common.releases import jessie script = os.path.join(info.root, 'etc/init.d/expand-root') root_idx = info.volume.partition_map.root.get_index() @@ -67,4 +68,5 @@ class AdjustExpandRootScript(Task): root_device_path = 'root_device_path="{device}"'.format(device=info.volume.device_path) sed_i(script, '^root_device_path="/dev/xvda"$', root_device_path) - sed_i(script, '^growpart="growpart"$', 'growpart-workaround') + if info.manifest.release >= jessie: + sed_i(script, '^growpart="growpart"$', 'growpart-workaround')