Guest User

Untitled

a guest
Jan 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. diff --git a/django-openstack/django_openstack/api.py b/django-openstack/django_openstack/api.py
  2. index ab08226..3b88fc6 100644
  3. --- a/django-openstack/django_openstack/api.py
  4. +++ b/django-openstack/django_openstack/api.py
  5. @@ -634,7 +634,7 @@ def token_create_scoped_with_token(request, tenant, token):
  6.  
  7.  
  8. def tenant_quota_get(request, tenant):
  9. - return admin_api(request).quota_sets.get(tenant)
  10. + return novaclient(request).quotas.get(tenant)
  11.  
  12.  
  13. @check_openstackx
  14. diff --git a/django-openstack/django_openstack/dash/views/images.py b/django-openstack/django_openstack/dash/views/images.py
  15. index 42a1f89..d94677a 100644
  16. --- a/django-openstack/django_openstack/dash/views/images.py
  17. +++ b/django-openstack/django_openstack/dash/views/images.py
  18. @@ -118,7 +118,7 @@ def index(request, tenant_id):
  19. tenant = {}
  20.  
  21. try:
  22. - tenant = api.token_get_tenant(request, request.user.tenant)
  23. + tenant = api.token_get_tenant(request, request.user.tenant_id)
  24. except api_exceptions.ApiException, e:
  25. messages.error(request, "Unable to retrienve tenant info\
  26. from keystone: %s" % e.message)
  27. @@ -185,8 +185,8 @@ def launch(request, tenant_id, image_id):
  28. # TODO(mgius): Any reason why these can't be after the launchform logic?
  29. # If The form is valid, we've just wasted these two api calls
  30. image = api.image_get(request, image_id)
  31. - tenant = api.token_get_tenant(request, request.user.tenant)
  32. - quotas = api.tenant_quota_get(request, request.user.tenant)
  33. + tenant = api.token_get_tenant(request, request.session['tenant_id'])
  34. + quotas = api.tenant_quota_get(request, request.session['tenant_id'])
  35. try:
  36. quotas.ram = int(quotas.ram) / 100
  37. except Exception, e:
Add Comment
Please, Sign In to add comment