Revision 55c87175

b/src/Ganeti/Query/Instance.hs
607 607

  
608 608
-- | Determines the status of a live instance
609 609
liveInstanceStatus :: (InstanceInfo, Bool) -> Instance -> InstanceStatus
610
liveInstanceStatus (_, foundOnPrimary) inst
611
  | not foundOnPrimary    = WrongNode
612
  | adminState == AdminUp = Running
613
  | otherwise             = ErrorUp
610
liveInstanceStatus (instInfo, foundOnPrimary) inst
611
  | not foundOnPrimary = WrongNode
612
  | otherwise =
613
    case instanceState of
614
      InstanceStateRunning | adminState == AdminUp -> Running
615
                           | otherwise -> ErrorUp
616
      InstanceStateShutdown | adminState == AdminUp -> UserDown
617
                            | otherwise -> StatusDown
614 618
  where adminState = instAdminState inst
619
        instanceState = instInfoState instInfo
615 620

  
616 621
-- | Determines the status of a dead instance.
617 622
deadInstanceStatus :: Instance -> InstanceStatus

Also available in: Unified diff