Commit 12ca5c50 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Fix default resource groups

parent 6f81f684
......@@ -94,26 +94,26 @@ ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT 'Password reset on %s alpha2 testing
ASTAKOS_QUOTA_HOLDER_URL '' The quota holder URI
e.g. ``http://localhost:8080/api/quotaholder/v``
ASTAKOS_SERVICES {'cyclades': {'resources': [{'desc': 'Number of virtual machines', Default cloud service information
'group': 'storage',
'group': 'compute',
'name': 'vm',
'uplimit': 2},
{'desc': 'Virtual machine disk size',
'group': 'storage',
'name': 'disksize',
'group': 'compute',
'name': 'diskspace',
'unit': 'GB',
'uplimit': 5},
{'desc': 'Number of virtual machine processors',
'group': 'storage',
'group': 'compute',
'name': 'cpu',
'uplimit': 1},
{'desc': 'Virtual machines',
'group': 'storage',
'group': 'compute',
'name': 'ram',
'unit': 'MB',
'uplimit': 1024}],
'url': 'https://node1.example.com/ui/'},
'pithos+': {'resources': [{'desc': 'Pithos account diskspace',
'group': 'compute',
'group': 'storage',
'name': 'diskspace',
'unit': 'bytes',
'uplimit': 5368709120}],
......
......@@ -37,7 +37,6 @@ class Migration(DataMigration):
name=rn,
defaults=r)
except Exception, e:
logger.exception(e)
print "Cannot create resource ", rn
continue
......@@ -61,9 +60,14 @@ class Migration(DataMigration):
for r in resources:
rn = r.get('name', '')
try:
q = orm.AstakosGroupQuota.objects.get(
group=default,
resource__name=rn)
q.delete()
q = orm.Resource.objects.get(service__name=sn, name=rn)
q.delete()
except orm.Resource.DoesNotExist:
except Exception, e:
print "Cannot create resource ", rn
continue
map(destroy_policies, SERVICES.iteritems())
......
......@@ -137,23 +137,23 @@ SERVICES = getattr(settings, 'ASTAKOS_SERVICES',{
'url': 'https://node1.example.com/ui/',
'resources': [{
'name':'vm',
'group':'storage',
'group':'compute',
'uplimit':2,
'desc': 'Number of virtual machines'
},{
'name':'disksize',
'group':'storage',
'group':'compute',
'uplimit':5,
'unit':'GB',
'desc': 'Virtual machine disk size'
},{
'name':'cpu',
'group':'storage',
'group':'compute',
'uplimit':1,
'desc': 'Number of virtual machine processors'
},{
'name':'ram',
'group':'storage',
'group':'compute',
'uplimit':1024,
'unit':'MB',
'desc': 'Virtual machines'
......@@ -163,7 +163,7 @@ SERVICES = getattr(settings, 'ASTAKOS_SERVICES',{
'url': 'https://node2.example.com/ui/',
'resources':[{
'name':'diskspace',
'group':'compute',
'group':'storage',
'uplimit':5 * 1024 * 1024 * 1024,
'unit':'bytes',
'desc': 'Pithos account diskspace'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment