Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
803c7821
authored
Sep 29, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: fix MigrateOperation (Unhandled exception: 'NoneType' object has no attribute 'host')
parent
f5f2eb9c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
circle/vm/models/instance.py
+7
-0
circle/vm/operations.py
+2
-1
No files found.
circle/vm/models/instance.py
View file @
803c7821
...
@@ -920,6 +920,13 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
...
@@ -920,6 +920,13 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
delete_dump
.
apply_async
(
args
=
[
self
.
mem_dump
[
'path'
]],
delete_dump
.
apply_async
(
args
=
[
self
.
mem_dump
[
'path'
]],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
def
reallocate_node
(
self
,
activity
):
with
activity
.
sub_activity
(
'scheduling'
,
readable_name
=
ugettext_noop
(
"schedule"
))
as
sa
:
sa
.
result
=
node
=
self
.
select_node
()
return
node
def
allocate_node
(
self
,
activity
):
def
allocate_node
(
self
,
activity
):
if
self
.
node
is
not
None
:
if
self
.
node
is
not
None
:
return
None
return
None
...
...
circle/vm/operations.py
View file @
803c7821
...
@@ -398,7 +398,7 @@ class MigrateOperation(InstanceOperation):
...
@@ -398,7 +398,7 @@ class MigrateOperation(InstanceOperation):
def
_operation
(
self
,
activity
,
to_node
=
None
,
timeout
=
120
):
def
_operation
(
self
,
activity
,
to_node
=
None
,
timeout
=
120
):
if
not
to_node
:
if
not
to_node
:
self
.
instance
.
allocate_node
(
activity
)
to_node
=
self
.
instance
.
re
allocate_node
(
activity
)
try
:
try
:
with
activity
.
sub_activity
(
with
activity
.
sub_activity
(
'migrate_vm'
,
readable_name
=
create_readable
(
'migrate_vm'
,
readable_name
=
create_readable
(
...
@@ -418,6 +418,7 @@ class MigrateOperation(InstanceOperation):
...
@@ -418,6 +418,7 @@ class MigrateOperation(InstanceOperation):
# Refresh node information
# Refresh node information
self
.
instance
.
node
=
to_node
self
.
instance
.
node
=
to_node
self
.
instance
.
save
()
self
.
instance
.
save
()
# Estabilish network connection (vmdriver)
# Estabilish network connection (vmdriver)
with
activity
.
sub_activity
(
with
activity
.
sub_activity
(
'deploying_net'
,
readable_name
=
ugettext_noop
(
'deploying_net'
,
readable_name
=
ugettext_noop
(
...
...
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