Merge remote-tracking branch 'mainRepo/master' into 7894/show-one-time-payment-invoices

This commit is contained in:
PCoder 2020-06-19 12:40:52 +05:30
commit ffae844ee5
5 changed files with 23 additions and 10 deletions

View file

@ -1,3 +1,17 @@
2.11: 2020-06-11
* Bugfix: Correct the wrong constant name (caused payment to go thru and showing error and VMs not instantiated)
2.10.8: 2020-06-10
* #8102: Refactor MAX_TIME_TO_WAIT_FOR_VM_TERMINATE to increase time to poll whether VM has been terminated or not (MR!737)
2.10.7: 2020-05-25
* Bugfix: Handle VM templates deleted in OpenNebula but VM instances still existing (MR!736)
Notes for deployment:
When deploying define a UPDATED_TEMPLATES string represented dictionary value in .env
```
# Represents Template Ids that were
# deleted and the new template Id to look for the template
# definition
UPDATED_TEMPLATES="{1: 100}"
```
2.10.6: 2020-03-25
* Bugfix: Handle Nonetype for discount's name (MR!735)
2.10.5: 2020-03-17

View file

@ -1011,14 +1011,6 @@ class OrderConfirmationView(DetailView, FormView):
user_hosting_key = UserHostingKey.objects.get(id=self.request.session['new_user_hosting_key_id'])
user_hosting_key.user = new_user
user_hosting_key.save()
owner = new_user
manager = OpenNebulaManager(
email=owner.username,
password=owner.password
)
keys_to_save = get_all_public_keys(new_user)
manager.save_key_in_opennebula_user('\n'.join(keys_to_save))
else:
# We assume that if the user is here, his/her StripeCustomer
# object already exists

View file

@ -768,6 +768,9 @@ UPDATED_TEMPLATES_DICT = {}
if UPDATED_TEMPLATES_STR:
UPDATED_TEMPLATES_DICT = eval(UPDATED_TEMPLATES_STR)
MAX_TIME_TO_WAIT_FOR_VM_TERMINATE = int_env(
'MAX_TIME_TO_WAIT_FOR_VM_TERMINATE', 15)
if DEBUG:
from .local import * # flake8: noqa
else:

View file

@ -1817,7 +1817,7 @@ class VirtualMachineView(LoginRequiredMixin, View):
)
response['text'] = str(_('Error terminating VM')) + str(vm.id)
else:
for t in range(15):
for t in range(settings.MAX_TIME_TO_WAIT_FOR_VM_TERMINATE):
try:
manager.get_vm(vm.id)
except WrongIdError:
@ -1840,6 +1840,10 @@ class VirtualMachineView(LoginRequiredMixin, View):
)
break
else:
logger.debug(
'Sleeping 2 seconds for terminate action on VM %s' %
vm.id
)
sleep(2)
if not response['status']:
response['text'] = str(_("VM terminate action timed out. "

View file

@ -266,7 +266,7 @@ class LdapManager:
logger.error(
"Error reading int value from {}. {}"
"Returning default value {} instead".format(
settings.LDAP_MAX_UID_PATH,
settings.LDAP_MAX_UID_FILE_PATH,
str(ve),
settings.LDAP_DEFAULT_START_UID
)