We ought to provide a new cluster configuration, identical as it may be to the 2.17 one for now. This increases the chances no one will slip up and fail to upgrade / downgrade a parameter.
On Fri, Oct 16, 2015 at 12:09 PM, 'Lisa Velden' via ganeti-devel < [email protected]> wrote: > Bump various versions to 2.17, remove downgrade code from cfgupgrade > and delete test_2_17_to_2_16_downgrade which doesn't work anymore > with the new version. > > Signed-off-by: Lisa Velden <[email protected]> > --- > NEWS | 6 ++++++ > configure.ac | 2 +- > lib/tools/cfgupgrade.py | 19 ++----------------- > test/py/cfgupgrade_unittest.py | 9 +-------- > 4 files changed, 10 insertions(+), 26 deletions(-) > > diff --git a/NEWS b/NEWS > index 37637b4..a4648a5 100644 > --- a/NEWS > +++ b/NEWS > @@ -2,6 +2,12 @@ News > ==== > > > +Version 2.18.0 alpha1 > +--------------------- > + > +*(unreleased)* > + > + > Version 2.17.0 alpha1 > --------------------- > > diff --git a/configure.ac b/configure.ac > index 777dd8a..4f003c1 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1,6 +1,6 @@ > # Configure script for Ganeti > m4_define([gnt_version_major], [2]) > -m4_define([gnt_version_minor], [17]) > +m4_define([gnt_version_minor], [18]) > m4_define([gnt_version_revision], [0]) > m4_define([gnt_version_suffix], [~alpha1]) > m4_define([gnt_version_full], > diff --git a/lib/tools/cfgupgrade.py b/lib/tools/cfgupgrade.py > index bc091da..1efb592 100644 > --- a/lib/tools/cfgupgrade.py > +++ b/lib/tools/cfgupgrade.py > @@ -59,11 +59,11 @@ from ganeti.utils import version > #: Target major version we will upgrade to > TARGET_MAJOR = 2 > #: Target minor version we will upgrade to > -TARGET_MINOR = 17 > +TARGET_MINOR = 18 > #: Target major version for downgrade > DOWNGRADE_MAJOR = 2 > #: Target minor version for downgrade > -DOWNGRADE_MINOR = 16 > +DOWNGRADE_MINOR = 17 > > # map of legacy device types > # (mapping differing old LD_* constants to new DT_* constants) > @@ -711,21 +711,6 @@ class CfgUpgrade(object): > # DOWNGRADE ------------------------------------------------------------ > > def DowngradeAll(self): > - if "maintenance" in self.config_data: > - del self.config_data["maintenance"] > - if "cluster" in self.config_data: > - cluster = self.config_data["cluster"] > - if "diagnose_data_collector_filename" in cluster: > - del cluster["diagnose_data_collector_filename"] > - if "data_collectors" in cluster: > - if constants.DATA_COLLECTOR_DIAGNOSE in > cluster["data_collectors"]: > - del > cluster["data_collectors"][constants.DATA_COLLECTOR_DIAGNOSE] > - if constants.DATA_COLLECTOR_KVM_R_S_S in > cluster["data_collectors"]: > - del > cluster["data_collectors"][constants.DATA_COLLECTOR_KVM_R_S_S] > - if "ipolicy" in cluster: > - ipolicy = cluster["ipolicy"] > - if "memory-ratio" in ipolicy: > - del ipolicy["memory-ratio"] > self.config_data["version"] = version.BuildVersion(DOWNGRADE_MAJOR, > DOWNGRADE_MINOR, 0) > return True > diff --git a/test/py/cfgupgrade_unittest.py > b/test/py/cfgupgrade_unittest.py > index 0706f53..20fa912 100755 > --- a/test/py/cfgupgrade_unittest.py > +++ b/test/py/cfgupgrade_unittest.py > @@ -439,13 +439,6 @@ class TestCfgupgrade(unittest.TestCase): > def testUpgradeFullConfigFrom_2_17(self): > self._TestUpgradeFromFile("cluster_config_2.17.json", False) > Please add a testUpgradeFullConfigFrom_2_18 here. > > - def test_2_17_to_2_16_downgrade(self): > - self._TestUpgradeFromFile("cluster_config_2.17.json", False) > - _RunUpgrade(self.tmpdir, False, True, downgrade=True) > - oldconf = self._LoadConfig() > - newconf = self._LoadTestDataConfig("cluster_config_2.16.json") > - self.assertEqual(oldconf, newconf) > - > Also, do not just delete this, but replace it with a 2_18 to 2_17 check? > def testUpgradeCurrent(self): > self._TestSimpleUpgrade(constants.CONFIG_VERSION, False) > > @@ -463,7 +456,7 @@ class TestCfgupgrade(unittest.TestCase): > def testDowngradeFullConfig(self): > """Test for upgrade + downgrade combination.""" > # This test can work only with the previous version of a > configuration! > - oldconfname = "cluster_config_2.16.json" > + oldconfname = "cluster_config_2.17.json" > self._TestUpgradeFromFile(oldconfname, False) > _RunUpgrade(self.tmpdir, False, True, downgrade=True) > oldconf = self._LoadTestDataConfig(oldconfname) > -- > 2.6.0.rc2.230.g3dd15c0 > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
