Feature Improve Agent
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
Owner
+1
-
-
-
-
| 32 | with act.sub_activity('change_password'): | |
| 33 | change_password.apply_async(queue=queue, args=(vm, instance.pw)) | |
| 34 | with act.sub_activity('set_time'): | |
| 35 | set_time.apply_async(queue=queue, args=(vm, time.time())) | |
| 36 | with act.sub_activity('set_hostname'): | |
| 37 | set_hostname.apply_async( | |
| 38 | queue=queue, args=(vm, instance.primary_host.hostname)) | |
| 39 | ||
| 40 | ||
| 24 | 41 | @celery.task |
| 25 | 42 | def agent_started(vm): |
| 26 | from vm.models import Instance, instance_activity | |
| 43 | from vm.models import Instance, instance_activity, InstanceActivity | |
| 27 | 44 | instance = Instance.objects.get(id=int(vm.split('-')[-1])) |
| 45 | initialized = InstanceActivity.objects.filter( | |
| 46 | instance=instance, activity_code='vm.Instance.agent').count() | |
Please
register
or
sign in
to reply
|
||
| 29 | 48 | with instance_activity(code_suffix='agent', instance=instance) as act: |
| 30 | 49 | with act.sub_activity('starting'): |
| 31 | queue = "%s.agent" % instance.node.host.hostname | |
| 32 | print queue | |
| 33 | restart_networking.apply_async(queue=queue, | |
| 34 | args=(vm, )) | |
| 35 | change_password.apply_async(queue=queue, | |
| 36 | args=(vm, instance.pw)) | |
| 37 | set_time.apply_async(queue=queue, | |
| 38 | args=(vm, time.time())) | |
| 39 | set_hostname.apply_async(queue=queue, | |
| 40 | args=(vm, instance.primary_host.hostname)) | |
| 50 | pass | |
| 51 | if not initialized: | |
| 52 | send_init_commands(instance, act, vm) | |
| 53 | with act.sub_activity('start_ssh'): | |
|
||
+1
mentioned in merge request !90 (merged)
mentioned in merge request !90 (merged)