Commit 3a90c680 by Őry Máté

Merge branch 'issue-290' into 'master'

Add a non-finished subactivity after updating agent

🚧 needs manual test
parents ea3039d6 0407bfa4
...@@ -27,6 +27,7 @@ from base64 import encodestring ...@@ -27,6 +27,7 @@ from base64 import encodestring
from StringIO import StringIO from StringIO import StringIO
from tarfile import TarFile, TarInfo from tarfile import TarFile, TarInfo
from django.conf import settings from django.conf import settings
from django.db.models import Q
from django.utils import timezone from django.utils import timezone
from django.utils.translation import ugettext_noop from django.utils.translation import ugettext_noop
from celery.result import TimeoutError from celery.result import TimeoutError
...@@ -97,8 +98,9 @@ def agent_started(vm, version=None): ...@@ -97,8 +98,9 @@ def agent_started(vm, version=None):
pass pass
for i in InstanceActivity.objects.filter( for i in InstanceActivity.objects.filter(
instance=instance, activity_code__endswith='.os_boot', (Q(activity_code__endswith='.os_boot') |
finished__isnull=True): Q(activity_code__endswith='.agent_wait')),
instance=instance, finished__isnull=True):
i.finish(True) i.finish(True)
if version and version != settings.AGENT_VERSION: if version and version != settings.AGENT_VERSION:
...@@ -107,6 +109,8 @@ def agent_started(vm, version=None): ...@@ -107,6 +109,8 @@ def agent_started(vm, version=None):
except TimeoutError: except TimeoutError:
pass pass
else: else:
act.sub_activity('agent_wait', readable_name=ugettext_noop(
"wait agent restarting"), interruptible=True)
return # agent is going to restart return # agent is going to restart
if not initialized: if not initialized:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment