Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1767d22c
authored
Sep 02, 2014
by
Bach Dániel
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent: call send_networking_commands() in AddInterfaceOperation
parent
05b07694
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
circle/vm/operations.py
+2
-1
circle/vm/tasks/local_agent_tasks.py
+15
-10
No files found.
circle/vm/operations.py
View file @
1767d22c
...
@@ -41,7 +41,7 @@ from .models import (
...
@@ -41,7 +41,7 @@ from .models import (
Instance
,
InstanceActivity
,
InstanceTemplate
,
Interface
,
Node
,
Instance
,
InstanceActivity
,
InstanceTemplate
,
Interface
,
Node
,
NodeActivity
,
pwgen
NodeActivity
,
pwgen
)
)
from
.tasks
import
agent_tasks
from
.tasks
import
agent_tasks
,
local_agent_tasks
from
dashboard.store_api
import
Store
,
NoStoreException
from
dashboard.store_api
import
Store
,
NoStoreException
...
@@ -153,6 +153,7 @@ class AddInterfaceOperation(InstanceOperation):
...
@@ -153,6 +153,7 @@ class AddInterfaceOperation(InstanceOperation):
self
.
rollback
(
net
,
activity
)
self
.
rollback
(
net
,
activity
)
raise
raise
net
.
deploy
()
net
.
deploy
()
local_agent_tasks
.
send_networking_commands
(
self
.
instance
,
activity
)
def
get_activity_name
(
self
,
kwargs
):
def
get_activity_name
(
self
,
kwargs
):
return
create_readable
(
ugettext_noop
(
"add
%(vlan)
s interface"
),
return
create_readable
(
ugettext_noop
(
"add
%(vlan)
s interface"
),
...
...
circle/vm/tasks/local_agent_tasks.py
View file @
1767d22c
...
@@ -33,7 +33,8 @@ from celery.result import TimeoutError
...
@@ -33,7 +33,8 @@ from celery.result import TimeoutError
from
monitor.client
import
Client
from
monitor.client
import
Client
def
send_init_commands
(
instance
,
act
,
vm
):
def
send_init_commands
(
instance
,
act
):
vm
=
instance
.
vm_name
queue
=
instance
.
get_remote_queue_name
(
"agent"
)
queue
=
instance
.
get_remote_queue_name
(
"agent"
)
with
act
.
sub_activity
(
'cleanup'
,
readable_name
=
ugettext_noop
(
'cleanup'
)):
with
act
.
sub_activity
(
'cleanup'
,
readable_name
=
ugettext_noop
(
'cleanup'
)):
cleanup
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
))
cleanup
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
))
...
@@ -48,6 +49,17 @@ def send_init_commands(instance, act, vm):
...
@@ -48,6 +49,17 @@ def send_init_commands(instance, act, vm):
queue
=
queue
,
args
=
(
vm
,
instance
.
primary_host
.
hostname
))
queue
=
queue
,
args
=
(
vm
,
instance
.
primary_host
.
hostname
))
def
send_networking_commands
(
instance
,
act
):
queue
=
instance
.
get_remote_queue_name
(
"agent"
)
with
act
.
sub_activity
(
'change_ip'
,
readable_name
=
ugettext_noop
(
'change ip'
)):
change_ip
.
apply_async
(
queue
=
queue
,
args
=
(
instance
.
vm_name
,
)
+
get_network_configs
(
instance
))
with
act
.
sub_activity
(
'restart_networking'
,
readable_name
=
ugettext_noop
(
'restart networking'
)):
restart_networking
.
apply_async
(
queue
=
queue
,
args
=
(
instance
.
vm_name
,
))
def
create_agent_tar
():
def
create_agent_tar
():
def
exclude
(
tarinfo
):
def
exclude
(
tarinfo
):
if
tarinfo
.
name
.
startswith
(
'./.git'
):
if
tarinfo
.
name
.
startswith
(
'./.git'
):
...
@@ -93,16 +105,9 @@ def agent_started(vm, version=None):
...
@@ -93,16 +105,9 @@ def agent_started(vm, version=None):
if
not
initialized
:
if
not
initialized
:
measure_boot_time
(
instance
)
measure_boot_time
(
instance
)
send_init_commands
(
instance
,
act
,
vm
)
send_init_commands
(
instance
,
act
)
with
act
.
sub_activity
(
'change_ip'
,
send_networking_commands
(
instance
,
act
)
readable_name
=
ugettext_noop
(
'change ip'
)):
change_ip
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
)
+
get_network_configs
(
instance
))
with
act
.
sub_activity
(
'restart_networking'
,
readable_name
=
ugettext_noop
(
'restart networking'
)):
restart_networking
.
apply_async
(
queue
=
queue
,
args
=
(
vm
,
))
with
act
.
sub_activity
(
with
act
.
sub_activity
(
'start_access_server'
,
'start_access_server'
,
readable_name
=
ugettext_noop
(
'start access server'
)
readable_name
=
ugettext_noop
(
'start access server'
)
...
...
Bach Dániel
@bachdaniel
mentioned in merge request
!176 (merged)
Sep 02, 2014
mentioned in merge request
!176 (merged)
mentioned in merge request !176
Toggle commit list
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