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
8745ef8d
Commit
8745ef8d
authored
12 years ago
by
Anael Beutot
Browse files
Options
Downloads
Patches
Plain Diff
Update libvirt related tags when libvirt connection state changes.
parent
c7abd77f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ccnode/hypervisor/__init__.py
+8
-1
8 additions, 1 deletion
ccnode/hypervisor/__init__.py
ccnode/hypervisor/domains/__init__.py
+1
-0
1 addition, 0 deletions
ccnode/hypervisor/domains/__init__.py
with
9 additions
and
1 deletion
ccnode/hypervisor/__init__.py
+
8
−
1
View file @
8745ef8d
...
...
@@ -45,7 +45,9 @@ class Handler(HostHandler):
def
virt_connected
(
self
,
value
):
self
.
_virt_connected
=
value
# update tags
for
tag
in
(
'
vir_status
'
,
'
hvver
'
,
'
libvirtver
'
):
for
tag
in
(
'
vir_status
'
,
'
sto
'
,
'
nvm
'
,
'
vmpaused
'
,
'
vmstarted
'
,
'
vmstopped
'
,
'
hvver
'
,
'
libvirtver
'
,
'
hv
'
):
# TODO tag annoucement
self
.
tag_db
[
'
__main__
'
][
tag
].
calculate_value
()
def
start
(
self
):
...
...
@@ -287,6 +289,11 @@ class Hypervisor(object):
state
)
vm
.
state
=
state
# update domain state counts
for
tag
in
(
'
nvm
'
,
'
vmpaused
'
,
'
vmstarted
'
,
'
vmstopped
'
):
# TODO tag announcement
self
.
handler
.
tag_db
[
'
__main__
'
][
tag
].
calculate_value
()
def
vm_define
(
self
,
xml_desc
):
"""
Create a VM on the Hypervisor
:param str xml_desc: XML description in libvirt format
...
...
This diff is collapsed.
Click to expand it.
ccnode/hypervisor/domains/__init__.py
+
1
−
0
View file @
8745ef8d
...
...
@@ -63,6 +63,7 @@ class VirtualMachine(object):
@state.setter
def
state
(
self
,
value
):
self
.
_state
=
value
# TODO tag announcement
self
.
tags
[
'
status
'
].
value
=
value
@property
...
...
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