On Tue, Nov 08, 2011 at 03:05:05PM +0100, Agata Murawska wrote: > This is simply a change of name to better reflect the future > (as in: introduced in the next patches) reality > > Signed-off-by: Agata Murawska <agatamuraw...@google.com> > --- > doc/iallocator.rst | 2 +- > lib/cmdlib.py | 54 ++++++++++++++++++++-------------------- > lib/config.py | 4 +- > lib/objects.py | 6 ++++ > lib/query.py | 6 ++-- > test/ganeti.query_unittest.py | 18 +++++++------- > tools/cfgupgrade12 | 2 +- > 7 files changed, 49 insertions(+), 43 deletions(-)
> diff --git a/lib/objects.py b/lib/objects.py > index 2467968..0078834 100644 > --- a/lib/objects.py > +++ b/lib/objects.py > @@ -742,6 +742,7 @@ class Instance(TaggableObject): > "beparams", > "osparams", > "admin_up", > + "admin_state", > "nics", > "disks", > "disk_template", > @@ -902,6 +903,11 @@ class Instance(TaggableObject): > pass > if self.osparams is None: > self.osparams = {} > + if self.admin_state is None: > + if self.admin_up: > + self.admin_state = constants.ADMINST_UP > + else: > + self.admin_state = constants.ADMINST_DOWN I think that here things are not quite OK. We should remove from the config the old state, at which point we won't be able to instantiate the instance object from the dist, so this needs to move up to the FromDict call, and modify the dict before we create the instance from it. > diff --git a/tools/cfgupgrade12 b/tools/cfgupgrade12 > index 83187c3..283a50e 100755 > --- a/tools/cfgupgrade12 > +++ b/tools/cfgupgrade12 > @@ -252,7 +252,7 @@ def Instance12To20(drbd_minors, secrets, hypervisor, > instance): > > # other instance changes > if 'status' in instance: > - instance['admin_up'] = instance['status'] == 'up' > + instance['admin_state'] = instance['status'] == 'up' > del instance['status'] you can drop this change here, because this script migrates ganeti 1.2 to 2.0 clusters, and not directly to 2.x (x>0). Rest seems good. thanks, iustin