Further fixes to instance policy validation
As a followup from "Remove extraneous check in policy creation", there are more places where we build an ipolicy, and then manually check for its validity. This is very bad style, as it duplicates the verification code across many places. This patch removes all such explicit checks (except for one in cmdlib.py which is correct), and instead does a bit more validation in the builder functions or in the actual dedicated verification functions. It also fixes cluster init which used the wrong, non-completed ipolicy (this was not detected before as we did call check on it, but otherwise we ignored it), and fixes a too-strong assert (due to the call chain, we first create the ipolicy from cmdline params, and only then we fill it). Finally, it removes an extraneous logging.info which I forgot from debugging. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
Showing
- lib/bootstrap.py 5 additions, 9 deletionslib/bootstrap.py
- lib/client/gnt_cluster.py 0 additions, 2 deletionslib/client/gnt_cluster.py
- lib/client/gnt_group.py 1 addition, 3 deletionslib/client/gnt_group.py
- lib/cmdlib.py 4 additions, 2 deletionslib/cmdlib.py
- lib/objects.py 6 additions, 0 deletionslib/objects.py
Loading
Please register or sign in to comment