History | View | Annotate | Download (12 kB)
Implement saving/restoring of policies in Text backend
This adds a new optional (so we're backwards-compat) section to thecluster data so that we can reliably save/restore the policy data.
Note that different from the other sections, we save all policies...
Further unittests for ipolicy/ispec text serialisation
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add ipolicy attribute to group objects
This is straightforward; as before, so far the text and simu backendshave no way to use a non-default ipolicy.
Furthermore, we do some unit-test preparation for future changes(these seem a no-op for now, but they are needed for later patches)....
Extend ClusterData with the cluster instance policy
This attribute is always initialised to the default, and is not (yet)read/saved in the various backends.
Cleanup hlint errors
First, we update the recommended hlint version to what I used to get aclean output (1.8.15). Most of the changes are:
- remove unneeded parentheses- some simplifications (intercalate " " → unwords, maybe … id → fromMaybe, etc.)- removal of some duplicate code (in previous patches)...
htools: reindent the rest of the files
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
htools: change runSt type to InstanceStatus
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Generalize the generation of ADT from raw types
Rename some helper functions for consistency
This changes the names for some helper functions so that futurepatches are touching less unrelated code. The change replacesshortened prefixes with the full type name.
Signed-off-by: Iustin Pop <iustin@google.com>...
htools: read/save the disk template in Text backend
This requires that we change the signature of loadInst in order toproperly annotate the error messages, which in turn requires moreunittest changes.
Also, this invalidates yet again saved data files…...
htools: add DiskTemplate to instance definition
Currently always fixed to DRBD8, as that is what we assume already.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
htools: rename Instance.auto_balance
… to autoBalance, per the recommended style.
htools: docstring fixes and improvements
No code changes (except one definition being moved around in QC.hs)are contained in this patch.
Read/write auto_balance via Text
This also means another change in the text format; we really shouldmove to json…
The unittests are also update for the new 9-column layout andadditionally a bit of improvement is done.
Add a new attribute to Instance.Instance
This will mirror Ganeti's be/auto_balance one, which we need to use toproperly match N+1 computations.
Fix some lint warnings in htools code
hlint gives more suggestions, but some make the code (IMHO) harder toread.
Fix lint errors in the htools code
These are just changes from hlint suggestions. Still compiles andpasses unittests.
Merge remote branch 'htools/master'