dynamicweb/hosting
PCoder cb16114aba Do not break the VM list when a VM's OpenNebula template was deleted
The "my virtual machines" page showed "We could not load your VMs due to a
backend connection error" for any user owning a VM whose template had been
removed from OpenNebula. OpenNebulaManager.get_template() converted every
failure, including WrongIdError for a missing template, into
ConnectionRefusedError, and VirtualMachineSerializer.get_configuration()
let that propagate, so one VM with a stale template id took down the whole
list. The only log output was an empty ERROR line, because WrongIdError
has no message.

* Add opennebula_api.exceptions.TemplateNotFoundError and raise it from
  get_template() for a missing template; keep ConnectionRefusedError for
  genuine backend failures and log them with a traceback.
* Add OpenNebulaManager.get_template_names() and resolve_template_id() so
  the serializer fetches the template pool once per list instead of
  constructing an OpenNebulaManager and fetching the pool for every VM.
* get_configuration() now falls back to the template name embedded in the
  VM name ("<template>-<vm id>") when the template is missing or the pool
  cannot be fetched, and logs why.
* Replace str.lstrip('public-') with a real prefix strip (lstrip removes a
  character set, so "public-ubuntu" became "ntu") and also strip
  "ipv6only-".
* ProcessVMSelectionMixin shows "configuration is no longer available"
  instead of an unhandled error when ordering a retired template.
* VirtualMachinesPlanListView logs the exception behind the banner.
* Add mock-based unit tests for the fallback, the UPDATED_TEMPLATES
  mapping, the single pool fetch and the new exception.

The UPDATED_TEMPLATES setting keeps working as an operational override for
mapping retired template ids to their replacements.
2026-10-19 20:53:32 +05:30
..
locale/de/LC_MESSAGES Fix missing escapes 2021-02-07 16:21:02 +05:30
management Add change_fi_vatrate_2024.py management command 2024-09-26 11:13:56 +02:00
migrations Add migration 2023-07-27 10:33:40 +02:00
static/hosting Remove unwanted code/comments 2021-01-07 16:30:33 +05:30
templates/hosting Fix invoices list not showing one time charges 2024-05-08 09:57:56 +02:00
__init__.py begin refactor to /hosting/ 2015-08-27 18:20:08 +02:00
admin.py Register GenericProduct to adminsite 2018-09-25 02:14:37 +02:00
forms.py Escape ssh key before storing 2020-11-12 12:12:46 +05:30
managers.py Added DjangoHostingView test, Added RailsHostingView test, Added, NodeJSHostingView test, Changed VMPlan model, Fixed templates to support new relationship between orders and VMplans, Merged Calendar feature with Booking 2016-05-05 01:03:35 -05:00
mixins.py Do not break the VM list when a VM's OpenNebula template was deleted 2026-10-19 20:53:32 +05:30
models.py Fix params passing to method 2025-05-27 11:47:48 +05:30
README-opennebula-integration.md Manual merge of develop into opennebula-integration 2017-04-26 10:40:52 +05:30
test_forms.py Replace all ungleich.com with ungleich.ch 2018-01-03 08:54:19 +01:00
test_models.py Commented code that was causing the error when executing the tests 2017-08-25 13:28:16 +05:30
test_views.py Replace all ungleich.com with ungleich.ch 2018-01-03 08:54:19 +01:00
tests.py Added Flake8 lib and fixed PEP8 violations 2017-06-29 17:34:40 +03:00
urls.py Fix issues on settings/card save/delete methods 2021-01-01 02:37:52 +05:30
views.py Do not break the VM list when a VM's OpenNebula template was deleted 2026-10-19 20:53:32 +05:30