Fetch correct cred
This commit is contained in:
parent
8c374af4ff
commit
9d85c058da
1 changed files with 5 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from datacenterlight.tasks import handle_metadata_and_emails
|
from datacenterlight.tasks import handle_metadata_and_emails
|
||||||
from opennebula_api.models import OpenNebulaManager
|
from opennebula_api.models import OpenNebulaManager
|
||||||
|
from membership.models import CustomUser
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
@ -54,16 +55,13 @@ class Command(BaseCommand):
|
||||||
'request_host': user_dict['request_host'],
|
'request_host': user_dict['request_host'],
|
||||||
'language': user_dict['language'],
|
'language': user_dict['language'],
|
||||||
}
|
}
|
||||||
|
cu = CustomUser.objects.get(username=user.get('username'))
|
||||||
on_user = user.get('username')
|
|
||||||
on_pass = user.get('pass')
|
|
||||||
|
|
||||||
# Create OpenNebulaManager
|
# Create OpenNebulaManager
|
||||||
self.style.SUCCESS(
|
self.style.SUCCESS(
|
||||||
'Connecting using %s %s' % (on_user, on_pass)
|
'Connecting using %s %s' % (cu.username, cu.password)
|
||||||
)
|
)
|
||||||
print('Connecting using %s %s' % (on_user, on_pass))
|
print('Connecting using %s %s' % (cu.username, cu.password))
|
||||||
manager = OpenNebulaManager(email=on_user, password=on_pass)
|
manager = OpenNebulaManager(email=cu.username, password=cu.password)
|
||||||
handle_metadata_and_emails(order_id, vm_id, manager, user, specs,
|
handle_metadata_and_emails(order_id, vm_id, manager, user, specs,
|
||||||
template)
|
template)
|
||||||
self.stdout.write(
|
self.stdout.write(
|
||||||
|
|
Loading…
Reference in a new issue