Revision 5850e990 htools/Ganeti/HTools/Cluster.hs

b/htools/Ganeti/HTools/Cluster.hs
1260 1260
    ReplacePrimary _ -> (printf "f r:%s f" c, [mig, rep c, mig])
1261 1261
  where morf = if Instance.isRunning i then "migrate" else "failover"
1262 1262
        mig = printf "%s -f %s" morf inam::String
1263
        mig_any = printf "%s -f -n %s %s" morf c inam
1264
        rep n = printf "replace-disks -n %s %s" n inam
1263
        mig_any = printf "%s -f -n %s %s" morf c inam::String
1264
        rep n = printf "replace-disks -n %s %s" n inam::String
1265 1265

  
1266 1266
-- | Converts a placement to string format.
1267 1267
printSolutionLine :: Node.List     -- ^ The node list
......
1285 1285
      (moves, cmds) =  computeMoves inst inam mv npri nsec
1286 1286
      -- FIXME: this should check instead/also the disk template
1287 1287
      ostr = if old_sec == Node.noSecondary
1288
               then printf "%s" opri
1289
               else printf "%s:%s" opri osec
1288
               then printf "%s" opri::String
1289
               else printf "%s:%s" opri osec::String
1290 1290
      nstr = if s == Node.noSecondary
1291
               then printf "%s" npri
1292
               else printf "%s:%s" npri nsec
1291
               then printf "%s" npri::String
1292
               else printf "%s:%s" npri nsec::String
1293 1293
  in (printf "  %3d. %-*s %-*s => %-*s %12.8f a=%s"
1294
      pos imlen inam pmlen (ostr::String)
1295
      pmlen (nstr::String) c moves,
1294
      pos imlen inam pmlen ostr pmlen nstr c moves,
1296 1295
      cmds)
1297 1296

  
1298 1297
-- | Return the instance and involved nodes in an instance move.

Also available in: Unified diff