Revision 72747d91 src/Ganeti/HTools/Backend/Rapi.hs
b/src/Ganeti/HTools/Backend/Rapi.hs | ||
---|---|---|
4 | 4 |
|
5 | 5 |
{- |
6 | 6 |
|
7 |
Copyright (C) 2009, 2010, 2011, 2012 Google Inc. |
|
7 |
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
|
|
8 | 8 |
|
9 | 9 |
This program is free software; you can redistribute it and/or modify |
10 | 10 |
it under the terms of the GNU General Public License as published by |
... | ... | |
138 | 138 |
vcpus <- extract "vcpus" beparams |
139 | 139 |
pnode <- extract "pnode" a >>= lookupNode ktn name |
140 | 140 |
snodes <- extract "snodes" a |
141 |
snode <- if null snodes
|
|
142 |
then return Node.noSecondary
|
|
143 |
else readEitherString (head snodes) >>= lookupNode ktn name
|
|
141 |
snode <- case snodes of
|
|
142 |
[] -> return Node.noSecondary
|
|
143 |
x:_ -> readEitherString x >>= lookupNode ktn name
|
|
144 | 144 |
running <- extract "status" a |
145 | 145 |
tags <- extract "tags" a |
146 | 146 |
auto_balance <- extract "auto_balance" beparams |
Also available in: Unified diff