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
2c97e81a
Commit
2c97e81a
authored
12 years ago
by
Anael Beutot
Browse files
Options
Downloads
Patches
Plain Diff
Report VNC tag only when valid.
When VM is not started, vnc port value is -1 in the libvirt domain XML config.
parent
3b61d09a
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
ccnode/hypervisor/domains/vm_tags.py
+7
-1
7 additions, 1 deletion
ccnode/hypervisor/domains/vm_tags.py
with
7 additions
and
1 deletion
ccnode/hypervisor/domains/vm_tags.py
+
7
−
1
View file @
2c97e81a
...
...
@@ -92,11 +92,17 @@ def memmax(dom):
def
vncport
(
dom
):
"""
VNC port for the VM console access.
"""
try
:
return
et
.
ElementTree
().
parse
(
port
=
et
.
ElementTree
().
parse
(
StringIO
(
dom
.
lv_dom
.
XMLDesc
(
0
))
).
find
(
'
devices/graphics
'
).
get
(
'
port
'
)
except
Exception
:
logger
.
exception
(
'
VNCPort
'
)
raise
if
0
<
port
<
65536
:
return
port
return
@ttl
(
10
)
...
...
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