Revision fcbc5bb3
b/db/Charger.py | ||
---|---|---|
1 |
# |
|
2 |
# Charger - Administration script |
|
3 |
# |
|
4 |
# Executed hourly to charge vm usage for each user |
|
5 |
# |
|
6 |
# Copyright © 2010 Greek Research and Technology Network |
|
7 |
# |
|
8 |
|
|
9 |
from db.models import * |
|
10 |
|
|
11 |
def charger(): |
|
12 |
return |
|
13 |
|
|
14 |
charger() |
b/db/DBController.py | ||
---|---|---|
3 | 3 |
# |
4 | 4 |
|
5 | 5 |
import zmq |
6 |
|
|
6 | 7 |
from db.models import * |
7 | 8 |
|
8 | 9 |
def main(): |
b/db/models.py | ||
---|---|---|
18 | 18 |
return '%s' % (str(name).strip(ganeti_prefix_id)) |
19 | 19 |
|
20 | 20 |
|
21 |
|
|
22 | 21 |
class Limit(models.Model): |
23 | 22 |
description = models.CharField(max_length=45) |
24 | 23 |
|
... | ... | |
50 | 49 |
""" |
51 | 50 |
self.credit = self.credit + self.monthly_rate |
52 | 51 |
|
53 |
# ensure that the user has not more credits than his quota
|
|
52 |
# ensure that the user has not more credits than his quota
|
|
54 | 53 |
if self.credit > self.quota: |
55 | 54 |
self.credit = self.quota |
56 | 55 |
|
Also available in: Unified diff