Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Mirror
cc-node
Commits
cb11bdda
Commit
cb11bdda
authored
9 years ago
by
Antoine Millet
Browse files
Options
Downloads
Patches
Plain Diff
Fixed closure bug in sto tag handling
parent
6c9afe17
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
cloudcontrol/node/hypervisor/lib.py
+8
-7
8 additions, 7 deletions
cloudcontrol/node/hypervisor/lib.py
with
8 additions
and
7 deletions
cloudcontrol/node/hypervisor/lib.py
+
8
−
7
View file @
cb11bdda
...
...
@@ -20,6 +20,7 @@ import logging
from
itertools
import
chain
,
imap
,
count
from
StringIO
import
StringIO
from
xml.etree
import
cElementTree
as
et
from
functools
import
partial
import
pyev
import
libvirt
...
...
@@ -321,17 +322,17 @@ class StorageIndex(object):
self
.
storages
[
s
.
name
]
=
s
# add tags
self
.
handler
.
tag_db
.
add_tags
((
Tag
(
'
sto%s_state
'
%
s
.
name
,
lambda
:
s
.
state
,
5
,
5
),
Tag
(
'
sto%s_size
'
%
s
.
name
,
lambda
:
s
.
capacity
,
5
,
5
),
Tag
(
'
sto%s_free
'
%
s
.
name
,
lambda
:
s
.
available
,
5
,
5
),
Tag
(
'
sto%s_state
'
%
s
.
name
,
partial
(
lambda
x
:
x
.
state
,
s
),
5
,
5
),
Tag
(
'
sto%s_size
'
%
s
.
name
,
partial
(
lambda
x
:
x
.
capacity
,
s
),
5
,
5
),
Tag
(
'
sto%s_free
'
%
s
.
name
,
partial
(
lambda
x
:
x
.
available
,
s
),
5
,
5
),
Tag
(
'
sto%s_used
'
%
s
.
name
,
lambda
:
s
.
capacity
-
s
.
available
,
5
,
5
),
Tag
(
'
sto%s_type
'
%
s
.
name
,
lambda
:
s
.
type
,
5
,
5
),
partial
(
lambda
x
:
x
.
capacity
-
x
.
available
,
s
),
5
,
5
),
Tag
(
'
sto%s_type
'
%
s
.
name
,
partial
(
lambda
x
:
x
.
type
,
s
),
5
,
5
),
Tag
(
'
sto%s_vol
'
%
s
.
name
,
lambda
:
'
'
.
join
(
s
.
volumes
)
if
s
.
volumes
and
not
s
.
is_shared
else
None
,
partial
(
lambda
x
:
'
'
.
join
(
x
.
volumes
)
if
x
.
volumes
and
not
x
.
is_shared
else
None
,
s
),
5
,
5
),
Tag
(
'
sto%s_ratio
'
%
s
.
name
,
lambda
:
'
%0.2f
'
%
(
1
-
float
(
s
.
available
)
/
s
.
capacity
),
5
,
5
),
partial
(
lambda
x
:
'
%0.2f
'
%
(
1
-
float
(
x
.
available
)
/
x
.
capacity
),
s
),
5
,
5
),
))
self
.
update_path_index
()
...
...
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