source: trunk/misc/operations_helpers/spacetime/diskwatcher.py

Last change on this file was bac24ae, checked in by david-sarah <david-sarah@…>, at 2011-10-07T03:30:31Z

Fix pyflakes warnings in misc/ directories other than misc/build_helpers. refs #1557

  • Property mode set to 100644
File size: 1005 bytes
Line 
1
2from axiom.item import Item
3from axiom.attributes import text, integer, timestamp
4
5
6class Sample(Item):
7    # we didn't originally set typeName, so it was generated from the
8    # fully-qualified classname ("diskwatcher.Sample"), then Axiom
9    # automatically lowercases and un-dot-ifies it to get
10    # "diskwatcher_sample". Now we explicitly provide a name.
11    typeName = "diskwatcher_sample"
12
13    # version 2 added the 'total' field
14    schemaVersion = 2
15
16    url = text(indexed=True)
17    when = timestamp(indexed=True)
18    total = integer()
19    used = integer()
20    avail = integer()
21
22def upgradeSample1to2(old):
23    return old.upgradeVersion("diskwatcher_sample", 1, 2,
24                              url=old.url,
25                              when=old.when,
26                              total=0,
27                              used=old.used,
28                              avail=old.avail)
29
30from axiom.upgrade import registerUpgrader
31registerUpgrader(upgradeSample1to2, "diskwatcher_sample", 1, 2)
Note: See TracBrowser for help on using the repository browser.