Skip to content
Snippets Groups Projects
Commit 4d32534b authored by Anael Beutot's avatar Anael Beutot
Browse files

Fix storage pool attributes

Was using a closure for tag function thus storage variable was always
referencing the last value of the iteration.
parent 356914b2
No related branches found
No related tags found
No related merge requests found
......@@ -85,12 +85,14 @@ class Handler(HostHandler):
# register hypervisor storage tags
for name, storage in self.hypervisor.storage.storages.iteritems():
self.tag_db.add_tags((
Tag('sto%s_state' % name, lambda: storage.state, 5, 5),
Tag('sto%s_size' % name, lambda: storage.capacity, 5, 5),
Tag('sto%s_free' % name, lambda: storage.available, 5, 5),
Tag('sto%s_state' % name, lambda sto: sto.state, 5, 5, storage),
Tag('sto%s_size' % name,
lambda sto: sto.capacity, 5, 5, storage),
Tag('sto%s_free' % name,
lambda sto: sto.available, 5, 5, storage),
Tag('sto%s_used' % name,
lambda: storage.capacity - storage.available, 5, 5),
Tag('sto%s_type' % name, lambda: storage.type, 5, 5),
lambda sto: sto.capacity - sto.available, 5, 5, storage),
Tag('sto%s_type' % name, lambda sto: sto.type, 5, 5, storage),
))
# register domains
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment