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 <andrew.garrett@getbraintree.com>
This commit is contained in:
Jesse Szwedko 2016-01-13 18:50:41 +00:00 committed by Andrew Garrett
parent 673d2a520d
commit 433cbf2ae4

View file

@ -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')