Revision 262a08a2 hscan.hs
b/hscan.hs | ||
---|---|---|
73 | 73 |
] |
74 | 74 |
|
75 | 75 |
-- | Generate node file data from node objects |
76 |
serializeNodes :: Cluster.NodeList -> String -> String
|
|
76 |
serializeNodes :: Node.List -> String -> String
|
|
77 | 77 |
serializeNodes nl csf = |
78 | 78 |
let nodes = Container.elems nl |
79 | 79 |
nlines = map |
... | ... | |
91 | 91 |
in unlines nlines |
92 | 92 |
|
93 | 93 |
-- | Generate instance file data from instance objects |
94 |
serializeInstances :: Cluster.NodeList -> Cluster.InstanceList
|
|
94 |
serializeInstances :: Node.List -> Instance.List
|
|
95 | 95 |
-> String -> String |
96 | 96 |
serializeInstances nl il csf = |
97 | 97 |
let instances = Container.elems il |
... | ... | |
99 | 99 |
(\inst -> |
100 | 100 |
let |
101 | 101 |
iname = Instance.name inst ++ csf |
102 |
pnode = cNameOf nl $ Instance.pnode inst
|
|
103 |
snode = cNameOf nl $ Instance.snode inst
|
|
102 |
pnode = Container.nameOf nl $ Instance.pnode inst
|
|
103 |
snode = Container.nameOf nl $ Instance.snode inst
|
|
104 | 104 |
in |
105 | 105 |
printf "%s|%d|%d|%s|%s|%s" |
106 | 106 |
iname (Instance.mem inst) (Instance.dsk inst) |
... | ... | |
111 | 111 |
in unlines nlines |
112 | 112 |
|
113 | 113 |
-- | Return a one-line summary of cluster state |
114 |
printCluster :: Cluster.NodeList -> Cluster.InstanceList
|
|
114 |
printCluster :: Node.List -> Instance.List
|
|
115 | 115 |
-> String |
116 | 116 |
printCluster nl il = |
117 | 117 |
let (bad_nodes, bad_instances) = Cluster.computeBadItems nl il |
Also available in: Unified diff