Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
41ec590a
authored
Jun 04, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add new agent tasks
parent
1c558830
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
circle/vm/tasks/agent_tasks.py
+10
-0
circle/vm/tasks/local_agent_tasks.py
+8
-1
No files found.
circle/vm/tasks/agent_tasks.py
View file @
41ec590a
...
@@ -41,3 +41,13 @@ def set_hostname(vm, time):
...
@@ -41,3 +41,13 @@ def set_hostname(vm, time):
@celery.task
(
name
=
'agent.mount_store'
)
@celery.task
(
name
=
'agent.mount_store'
)
def
mount_store
(
vm
,
host
,
username
,
password
):
def
mount_store
(
vm
,
host
,
username
,
password
):
pass
pass
@celery.task
(
name
=
'agent.cleanup'
)
def
cleanup
(
vm
):
pass
@celery.task
(
name
=
'agent.start_ssh'
)
def
start_ssh
(
vm
):
pass
circle/vm/tasks/local_agent_tasks.py
View file @
41ec590a
...
@@ -17,13 +17,16 @@
...
@@ -17,13 +17,16 @@
from
manager.mancelery
import
celery
from
manager.mancelery
import
celery
from
vm.tasks.agent_tasks
import
(
restart_networking
,
change_password
,
from
vm.tasks.agent_tasks
import
(
restart_networking
,
change_password
,
set_time
,
set_hostname
)
set_time
,
set_hostname
,
start_ssh
,
cleanup
)
import
time
import
time
def
send_init_commands
(
instance
,
act
,
vm
):
def
send_init_commands
(
instance
,
act
,
vm
):
queue
=
instance
.
get_remote_queue_name
(
"agent"
)
queue
=
instance
.
get_remote_queue_name
(
"agent"
)
with
act
.
sub_activity
(
'cleanup'
):
cleanup
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
))
with
act
.
sub_activity
(
'restart_networking'
):
with
act
.
sub_activity
(
'restart_networking'
):
restart_networking
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
))
restart_networking
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
))
with
act
.
sub_activity
(
'change_password'
):
with
act
.
sub_activity
(
'change_password'
):
...
@@ -47,6 +50,10 @@ def agent_started(vm):
...
@@ -47,6 +50,10 @@ def agent_started(vm):
pass
pass
if
not
initialized
:
if
not
initialized
:
send_init_commands
(
instance
,
act
,
vm
)
send_init_commands
(
instance
,
act
,
vm
)
with
act
.
sub_activity
(
'start_ssh'
):
queue
=
instance
.
get_remote_queue_name
(
"agent"
)
start_ssh
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
))
@celery.task
@celery.task
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment