• Iustin Pop's avatar
    Fix the watcher not restarting instance bug · b7309a0d
    Iustin Pop authored
    The watcher was using conflicting attributes of the instance:
      - it queried the admin_/oper_state, which are booleans
      - but it compared those to the status (which is a text field)
    
    The code was changed to query the aggregated 'status' field, as that
    will also return indication of node problems, and we can use this only
    one field for all decisions. We still ask for the admin_state field as
    that is needed for the activate disks check (in secondary node restart).
    
    The patch also touches the watcher in some other parts:
      - log exceptions nicer
      - convert a method to @staticmethod
      - remove unused imports
    
    Reviewed-by: imsnah
    b7309a0d
ganeti-watcher 12.2 KB