• Iustin Pop's avatar
    Rework node role changes · 21232d04
    Iustin Pop authored
    
    
    There have been many bugs in gnt-node modify. Let's try to introduce
    some more.
    
    This patch reworks the node role changes from tracking the flag changes
    to completely overwriting the flags based on the new role. This paves
    the way for (in 2.4 or later) moving to a single attribute for nodes.
    
    We compute the old role and the new role based on the required changes
    and whether we need to auto-promote. Once this is done, the body of the
    Exec() function becomes trivial (there's more code related to output
    formatting than the node flag changes).
    
    Another advantage of the new version is that the entire flags are
    overwritten, and that all are changed at the same time, making it
    impossible (harder?) to have partial updates.
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    21232d04
cmdlib.py 372 KB