Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
12022233
Commit
12022233
authored
Apr 02, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6770 from lemonlatte/fix_default_uri_of_get_xml
Fix the default url of get_xml function.
parents
3ba01cac
48dc27ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
library/cloud/virt
+7
-9
No files found.
library/cloud/virt
View file @
12022233
...
...
@@ -108,7 +108,7 @@ VIRT_STATE_NAME_MAP = {
6
:
"crashed"
}
class
VMNotFound
(
Exception
):
class
VMNotFound
(
Exception
):
pass
class
LibvirtConnection
(
object
):
...
...
@@ -197,6 +197,10 @@ class LibvirtConnection(object):
def
get_type
(
self
):
return
self
.
conn
.
getType
()
def
get_xml
(
self
,
vmid
):
vm
=
self
.
conn
.
lookupByName
(
vmid
)
return
vm
.
XMLDesc
(
0
)
def
get_maxVcpus
(
self
,
vmid
):
vm
=
self
.
conn
.
lookupByName
(
vmid
)
return
vm
.
maxVcpus
()
...
...
@@ -361,14 +365,8 @@ class Virt(object):
Return an xml describing vm config returned by a libvirt call
"""
conn
=
libvirt
.
openReadOnly
(
None
)
if
not
conn
:
return
(
-
1
,
'Failed to open connection to the hypervisor'
)
try
:
domV
=
conn
.
lookupByName
(
vmid
)
except
:
return
(
-
1
,
'Failed to find the main domain'
)
return
domV
.
XMLDesc
(
0
)
self
.
__get_conn
()
return
self
.
conn
.
get_xml
(
vmid
)
def
get_maxVcpus
(
self
,
vmid
):
"""
...
...
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