Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-node
Commits
5b4552dc
Commit
5b4552dc
authored
12 years ago
by
Anael Beutot
Browse files
Options
Downloads
Patches
Plain Diff
Recreate domain when libvirt send us a create event and domain already exists.
parent
35b3fe63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cloudcontrol/node/hypervisor/__init__.py
+7
-0
7 additions, 0 deletions
cloudcontrol/node/hypervisor/__init__.py
with
7 additions
and
0 deletions
cloudcontrol/node/hypervisor/__init__.py
+
7
−
0
View file @
5b4552dc
...
...
@@ -652,6 +652,13 @@ class Hypervisor(object):
event
=
EVENTS
[
event
]
if
event
==
'
Added
'
:
if
dom
.
name
()
in
self
.
domains
:
# sometimes libvirt send us the same event multiple times
# this can be the result of a change in the domain configuration
# we first remove the old domain
vm
=
self
.
domains
.
pop
(
dom
.
name
())
self
.
handler
.
tag_db
.
remove_sub_object
(
vm
.
name
)
logger
.
debug
(
'
Domain %s recreated
'
,
dom
.
name
())
vm
=
VirtualMachine
(
dom
,
self
)
logger
.
info
(
'
Created domain %s
'
,
vm
.
name
)
self
.
domains
[
vm
.
name
]
=
vm
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment