summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>2013-06-13 09:27:38 -0400
committerMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>2013-06-14 00:12:46 -0400
commit73f71555ca16360f06a2337848dfc0a02119508f (patch)
treea5231be3a9b13109681397295821666241a1e117 /nova/utils.py
parentf6838316da6f69851cba06f9b45a91a2ee04179a (diff)
downloadnova-73f71555ca16360f06a2337848dfc0a02119508f.tar.gz
nova-73f71555ca16360f06a2337848dfc0a02119508f.tar.xz
nova-73f71555ca16360f06a2337848dfc0a02119508f.zip
Organize limits units and per-units constants
During v3 api review there was an agreement that would be nice to move limits constants to utils file and refactor its usage inside limits api to avoid unnecessary code duplication. Also changed TestLimiter class to MockLimiter since that name can be confuse to some unit test frameworks. Change-Id: I1b8626e8d1e3257333d4dfee61591fd4cde82bd1
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 338e4d880..b8cb1d5a8 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -96,6 +96,14 @@ BYTE_MULTIPLIERS = {
'k': 1024,
}
+# used in limits
+TIME_UNITS = {
+ 'SECOND': 1,
+ 'MINUTE': 60,
+ 'HOUR': 3600,
+ 'DAY': 84400
+}
+
synchronized = lockutils.synchronized_with_prefix('nova-')