remove trusty requirement to allow xenial upgrades
Closes-Bug: #1709962 Closes-Bug: #1710645 Change-Id: I1b6d91f0f09f0142f4470d8ae3eea650165a0575
This commit is contained in:
parent
7384c244ea
commit
8b0e49acdf
|
@ -57,7 +57,6 @@ from charmhelpers.fetch import (
|
|||
get_upstream_version,
|
||||
)
|
||||
from charmhelpers.core.sysctl import create as create_sysctl
|
||||
from charmhelpers.core import host
|
||||
from charmhelpers.contrib.openstack.context import AppArmorContext
|
||||
from utils import (
|
||||
get_host_ip,
|
||||
|
@ -87,12 +86,6 @@ def check_for_upgrade():
|
|||
log("Ceph is not bootstrapped, skipping upgrade checks.")
|
||||
return
|
||||
|
||||
release_info = host.lsb_release()
|
||||
if not release_info['DISTRIB_CODENAME'] == 'trusty':
|
||||
log("Invalid upgrade path from {}. Only trusty is currently "
|
||||
"supported".format(release_info['DISTRIB_CODENAME']))
|
||||
return
|
||||
|
||||
c = hookenv.config()
|
||||
old_version = ceph.resolve_ceph_version(c.previous('source') or
|
||||
'distro')
|
||||
|
|
|
@ -23,17 +23,13 @@ class UpgradeRollingTestCase(unittest.TestCase):
|
|||
@patch('ceph_hooks.ceph.resolve_ceph_version')
|
||||
@patch('ceph_hooks.emit_cephconf')
|
||||
@patch('ceph_hooks.hookenv')
|
||||
@patch('ceph_hooks.host')
|
||||
@patch('ceph_hooks.ceph.roll_osd_cluster')
|
||||
def test_check_for_upgrade(self, roll_osd_cluster, host, hookenv,
|
||||
def test_check_for_upgrade(self, roll_osd_cluster, hookenv,
|
||||
emit_cephconf, version, is_bootstrapped,
|
||||
dirs_need_ownership_update):
|
||||
dirs_need_ownership_update.return_value = False
|
||||
is_bootstrapped.return_value = True
|
||||
version.side_effect = ['firefly', 'hammer']
|
||||
host.lsb_release.return_value = {
|
||||
'DISTRIB_CODENAME': 'trusty',
|
||||
}
|
||||
previous_mock = MagicMock().return_value
|
||||
previous_mock.previous.return_value = "cloud:trusty-juno"
|
||||
hookenv.config.side_effect = [previous_mock,
|
||||
|
@ -50,16 +46,14 @@ class UpgradeRollingTestCase(unittest.TestCase):
|
|||
@patch('ceph_hooks.ceph.resolve_ceph_version')
|
||||
@patch('ceph_hooks.emit_cephconf')
|
||||
@patch('ceph_hooks.hookenv')
|
||||
@patch('ceph_hooks.host.lsb_release')
|
||||
@patch('ceph_hooks.ceph.roll_osd_cluster')
|
||||
def test_resume_failed_upgrade(self, roll_osd_cluster, lsb_release,
|
||||
def test_resume_failed_upgrade(self, roll_osd_cluster,
|
||||
hookenv, emit_cephconf, version,
|
||||
is_bootstrapped,
|
||||
dirs_need_ownership_update):
|
||||
dirs_need_ownership_update.return_value = True
|
||||
is_bootstrapped.return_value = True
|
||||
version.side_effect = ['jewel', 'jewel']
|
||||
lsb_release.return_value = {'DISTRIB_CODENAME': 'trusty'}
|
||||
|
||||
check_for_upgrade()
|
||||
|
||||
|
@ -71,16 +65,12 @@ class UpgradeRollingTestCase(unittest.TestCase):
|
|||
@patch('ceph_hooks.ceph.is_bootstrapped')
|
||||
@patch('ceph_hooks.ceph.resolve_ceph_version')
|
||||
@patch('ceph_hooks.hookenv')
|
||||
@patch('ceph_hooks.host')
|
||||
@patch('ceph_hooks.ceph.roll_monitor_cluster')
|
||||
def test_check_for_upgrade_not_bootstrapped(self, roll_monitor_cluster,
|
||||
host, hookenv,
|
||||
hookenv,
|
||||
version, is_bootstrapped):
|
||||
is_bootstrapped.return_value = False
|
||||
version.side_effect = ['firefly', 'hammer']
|
||||
host.lsb_release.return_value = {
|
||||
'DISTRIB_CODENAME': 'trusty',
|
||||
}
|
||||
previous_mock = MagicMock().return_value
|
||||
previous_mock.previous.return_value = "cloud:trusty-juno"
|
||||
hookenv.config.side_effect = [previous_mock,
|
||||
|
|
Loading…
Reference in New Issue