From 7be92c72d48941259b80e77a84c2d51727a216a7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 25 Nov 2017 21:49:04 +0100 Subject: [PATCH] Add skipIf condition to create_vm_task --- datacenterlight/tasks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 3db6eb54..0767a07d 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -8,6 +8,7 @@ from django.core.mail import EmailMessage from django.core.urlresolvers import reverse from django.utils import translation from django.utils.translation import ugettext_lazy as _ +from unittest import skipIf from dynamicweb.celery import app from hosting.models import HostingOrder, HostingBill @@ -48,6 +49,8 @@ def retry_task(task, exception=None): raise task.retry(**kwargs) +@skipIf(settings.OPENNEBULA_USERNAME is None or + settings.OPENNEBULA_PASSWORD is None) @app.task(bind=True, max_retries=settings.CELERY_MAX_RETRIES) def create_vm_task(self, vm_template_id, user, specs, template, stripe_customer_id, billing_address_data,