LGTM, thanks! On Tue, Feb 17, 2015 at 1:03 PM, 'Klaus Aehlig' via ganeti-devel < ganeti-devel@googlegroups.com> wrote:
> Upgrading should work with arbitrary not-newer versions without > losing data already present. In particular, it should be idempotent. > Just overriding the value with a constant does not have this > property. Fix it. > > Signed-off-by: Klaus Aehlig <aeh...@google.com> > --- > tools/cfgupgrade | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/tools/cfgupgrade b/tools/cfgupgrade > index 398ac70..7616c78 100755 > --- a/tools/cfgupgrade > +++ b/tools/cfgupgrade > @@ -171,9 +171,11 @@ def UpgradeCluster(config_data): > cluster.get("compression_tools", constants.IEC_DEFAULT_TOOLS) > if "enabled_user_shutdown" not in cluster: > cluster["enabled_user_shutdown"] = False > - cluster["data_collectors"] = dict( > - (name, dict(active=True, interval=constants.MOND_TIME_INTERVAL * 1e6)) > - for name in constants.DATA_COLLECTOR_NAMES) > + cluster["data_collectors"] = cluster.get("data_collectors", {}) > + for name in constants.DATA_COLLECTOR_NAMES: > + cluster["data_collectors"][name] = \ > + cluster["data_collectors"].get( > + name, dict(active=True, interval=constants.MOND_TIME_INTERVAL * > 1e6)) > > > def UpgradeGroups(config_data): > -- > 2.2.0.rc0.207.ga3a616c > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnummer: DE813741370