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
f5197d89
Commit
f5197d89
authored
15 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Change the signatures of the text loader slightly
This is in preparation for the text format changes.
parent
f6044dc4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ganeti/HTools/Text.hs
+5
-6
5 additions, 6 deletions
Ganeti/HTools/Text.hs
with
5 additions
and
6 deletions
Ganeti/HTools/Text.hs
+
5
−
6
View file @
f5197d89
...
...
@@ -80,11 +80,10 @@ loadInst _ s = fail $ "Invalid/incomplete instance data: '" ++ show s ++ "'"
-- @gnt-instance list@ and @gnt-node list@ to a list of objects using
-- a supplied conversion function.
loadTabular
::
(
Monad
m
,
Element
a
)
=>
String
->
([
String
]
->
m
(
String
,
a
))
[
String
]
->
([
String
]
->
m
(
String
,
a
))
->
m
([(
String
,
Int
)],
[(
Int
,
a
)])
loadTabular
text_data
convert_fn
=
do
let
lines_data
=
lines
text_data
rows
=
map
(
sepSplit
'|'
)
lines_data
loadTabular
lines_data
convert_fn
=
do
let
rows
=
map
(
sepSplit
'|'
)
lines_data
kerows
<-
mapM
convert_fn
rows
return
$
assignIndices
kerows
...
...
@@ -97,7 +96,7 @@ loadData nfile ifile = do -- IO monad
idata
<-
readFile
ifile
return
$
do
{- node file: name t_mem n_mem f_mem t_disk f_disk -}
(
ktn
,
nl
)
<-
loadTabular
ndata
loadNode
(
ktn
,
nl
)
<-
loadTabular
(
lines
ndata
)
loadNode
{- instance file: name mem disk status pnode snode -}
(
_
,
il
)
<-
loadTabular
idata
(
loadInst
ktn
)
(
_
,
il
)
<-
loadTabular
(
lines
idata
)
(
loadInst
ktn
)
return
(
nl
,
il
,
[]
)
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