On Tue, Oct 06, 2015 at 06:31:26PM +0200, 'Oleg Ponomarev' via ganeti-devel
wrote:
> Currently hv-state_static is supported only for cluster object properly.
> Convert hv_state_static from None to {} in ConfigUpgrade for NodeGroup
> and Node as well. Also modify mock config objects to return empty
> dictionaries.
>
> Signed-off-by: Oleg Ponomarev <[email protected]>
> ---
> lib/objects.py | 10 ++++++++++
> test/py/ganeti.masterd.iallocator_unittest.py | 4 ++++
> test/py/testutils/config_mock.py | 5 +++--
> 3 files changed, 17 insertions(+), 2 deletions(-)
This patch uncovers an old inconsistency between the Haskell and the python
implementation. Therefore, I suggest, you squash the following into this patch.
commit 85d3f10ae10356774cb9e5ec80423c2bd3300069
Author: Klaus Aehlig <[email protected]>
Date: Wed Oct 7 10:50:12 2015 +0200
...Implement hv_state_static support in objects.py and update test mocks
while there, also acknowlege that nodes and node groups can have
disk_state_static as parameters. They were introduced in 2da9f556,
however only on the python side.
diff --git a/src/Ganeti/Objects.hs b/src/Ganeti/Objects.hs
index 1d1ba06..e1060f7 100644
--- a/src/Ganeti/Objects.hs
+++ b/src/Ganeti/Objects.hs
@@ -421,6 +421,8 @@ $(buildObject "Node" "node" $
, simpleField "powered" [t| Bool |]
, defaultField [| emptyContainer |] $
simpleField "hv_state_static" [t| PartialHvState |]
+ , defaultField [| emptyContainer |] $
+ simpleField "disk_state_static" [t| Container JSValue |]
]
++ timeStampFields
++ uuidFields
@@ -458,6 +460,8 @@ $(buildObject "NodeGroup" "group" $
, simpleField "networks" [t| Networks |]
, defaultField [| emptyContainer |] $
simpleField "hv_state_static" [t| PartialHvState |]
+ , defaultField [| emptyContainer |] $
+ simpleField "disk_state_static" [t| Container JSValue |]
]
++ timeStampFields
++ uuidFields
--
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores