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

View file

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