Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
1297ce13
Commit
1297ce13
authored
May 21, 2009
by
Iustin Pop
Browse files
Small syntax improvement
D'oh, one can extract from a wrapped variable, not only from functions.
parent
fd22ce8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Ganeti/HTools/Rapi.hs
View file @
1297ce13
...
...
@@ -39,19 +39,19 @@ getInstances :: String -> IO (Result String)
getInstances
master
=
do
let
url2
=
printf
"%s/2/instances?bulk=1"
(
formatHost
master
)
body
<-
getUrl
url2
return
$
(
body
>>=
\
x
->
do
arr
<-
loadJSArray
x
ilist
<-
mapM
parseInstance
arr
return
$
unlines
ilist
)
return
$
(
do
x
<-
body
arr
<-
loadJSArray
x
ilist
<-
mapM
parseInstance
arr
return
$
unlines
ilist
)
getNodes
::
String
->
IO
(
Result
String
)
getNodes
master
=
do
let
url2
=
printf
"%s/2/nodes?bulk=1"
(
formatHost
master
)
body
<-
getUrl
url2
return
$
(
body
>>=
\
x
->
do
arr
<-
loadJSArray
x
nlist
<-
mapM
parseNode
arr
return
$
unlines
nlist
)
return
$
(
do
x
<-
body
arr
<-
loadJSArray
x
nlist
<-
mapM
parseNode
arr
return
$
unlines
nlist
)
parseInstance
::
JSObject
JSValue
->
Result
String
parseInstance
a
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment