Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
1297ce13
Commit
1297ce13
authored
15 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Small syntax improvement
D'oh, one can extract from a wrapped variable, not only from functions.
parent
fd22ce8e
No related branches found
Branches containing commit
Tags
htools-v0.0.6
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ganeti/HTools/Rapi.hs
+8
-8
8 additions, 8 deletions
Ganeti/HTools/Rapi.hs
with
8 additions
and
8 deletions
Ganeti/HTools/Rapi.hs
+
8
−
8
View file @
1297ce13
...
@@ -39,19 +39,19 @@ getInstances :: String -> IO (Result String)
...
@@ -39,19 +39,19 @@ getInstances :: String -> IO (Result String)
getInstances
master
=
do
getInstances
master
=
do
let
url2
=
printf
"%s/2/instances?bulk=1"
(
formatHost
master
)
let
url2
=
printf
"%s/2/instances?bulk=1"
(
formatHost
master
)
body
<-
getUrl
url2
body
<-
getUrl
url2
return
$
(
body
>>=
\
x
->
do
return
$
(
do
x
<-
body
arr
<-
loadJSArray
x
arr
<-
loadJSArray
x
ilist
<-
mapM
parseInstance
arr
ilist
<-
mapM
parseInstance
arr
return
$
unlines
ilist
)
return
$
unlines
ilist
)
getNodes
::
String
->
IO
(
Result
String
)
getNodes
::
String
->
IO
(
Result
String
)
getNodes
master
=
do
getNodes
master
=
do
let
url2
=
printf
"%s/2/nodes?bulk=1"
(
formatHost
master
)
let
url2
=
printf
"%s/2/nodes?bulk=1"
(
formatHost
master
)
body
<-
getUrl
url2
body
<-
getUrl
url2
return
$
(
body
>>=
\
x
->
do
return
$
(
do
x
<-
body
arr
<-
loadJSArray
x
arr
<-
loadJSArray
x
nlist
<-
mapM
parseNode
arr
nlist
<-
mapM
parseNode
arr
return
$
unlines
nlist
)
return
$
unlines
nlist
)
parseInstance
::
JSObject
JSValue
->
Result
String
parseInstance
::
JSObject
JSValue
->
Result
String
parseInstance
a
=
parseInstance
a
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment