Use opennebula user credentials to find if vm belongs to user

This commit is contained in:
PCoder 2019-08-27 11:13:31 +05:30
parent 55f55b6885
commit b2d597232c
1 changed files with 2 additions and 1 deletions

View File

@ -1731,7 +1731,8 @@ class CheckUserVM(APIView):
response = check_otp(user, realm, token)
if response != 200:
return Response('Invalid token', 403)
manager = OpenNebulaManager()
manager = OpenNebulaManager(settings.OPENNEBULA_USERNAME,
settings.OPENNEBULA_PASSWORD)
# not the best way to lookup vms by ip
# TODO: make this optimal
vms = manager.get_vms()