cc_growpart: prefer growpart over parted 'resizepart'
the resizepart code was not functional. We will re-favor it later under bug 1212492. For now, we'll just favor the 'growpart' resizer. Both will be found in Ubuntu cloud images.
This commit is contained in:
parent
c2268e6aaf
commit
2c9053ccc0
@ -96,7 +96,7 @@ class ResizeParted(object):
|
||||
def resize(self, diskdev, partnum, partdev):
|
||||
before = get_size(partdev)
|
||||
try:
|
||||
util.subp(["parted", "resizepart", diskdev, partnum])
|
||||
util.subp(["parted", diskdev, "resizepart", partnum])
|
||||
except util.ProcessExecutionError as e:
|
||||
raise ResizeFailedException(e)
|
||||
|
||||
@ -272,4 +272,6 @@ def handle(_name, cfg, _cloud, log, _args):
|
||||
else:
|
||||
log.debug("'%s' %s: %s" % (entry, action, msg))
|
||||
|
||||
RESIZERS = (('parted', ResizeParted), ('growpart', ResizeGrowPart))
|
||||
# LP: 1212444 FIXME re-order and favor ResizeParted
|
||||
#RESIZERS = (('growpart', ResizeGrowPart),)
|
||||
RESIZERS = (('growpart', ResizeGrowPart), ('parted', ResizeParted))
|
||||
|
@ -9,6 +9,7 @@ import errno
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import unittest
|
||||
|
||||
# growpart:
|
||||
# mode: auto # off, on, auto, 'growpart', 'parted'
|
||||
@ -121,6 +122,7 @@ class TestConfig(MockerTestCase):
|
||||
# Order must be correct
|
||||
self.mocker.order()
|
||||
|
||||
@unittest.skip("until LP: #1212444 fixed")
|
||||
def test_no_resizers_auto_is_fine(self):
|
||||
subp = self.mocker.replace(util.subp, passthrough=False)
|
||||
subp(['parted', '--help'], env={'LANG': 'C'})
|
||||
@ -142,6 +144,7 @@ class TestConfig(MockerTestCase):
|
||||
self.assertRaises(ValueError, self.handle, self.name, config,
|
||||
self.cloud_init, self.log, self.args)
|
||||
|
||||
@unittest.skip("until LP: #1212444 fixed")
|
||||
def test_mode_auto_prefers_parted(self):
|
||||
subp = self.mocker.replace(util.subp, passthrough=False)
|
||||
subp(['parted', '--help'], env={'LANG': 'C'})
|
||||
|
Loading…
x
Reference in New Issue
Block a user