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
48dc27ea
Commit
48dc27ea
authored
Mar 31, 2014
by
Jim Yeh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the default url of get_xml function.
* This enable a user to configure uri in get_xml function
parent
6792c76c
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 @
48dc27ea
...
...
@@ -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