<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"\6279\6CE8\6846\6587\672C Char";
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:9.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.Char
        {mso-style-name:"\6279\6CE8\6846\6587\672C Char";
        mso-style-priority:99;
        mso-style-link:\6279\6CE8\6846\6587\672C;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>Hi,all<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> How
can I use overt-engine-sdk in the python environment below python2.7,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>For example, when I use it in python 2.6.5
like thus:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>percy@percy-desktop:~/thtf-client$ python
--version<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Python 2.6.5<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>percy@percy-desktop:~/thtf-client$ python<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Python 2.6.5 (r265:79063, Oct 1 2012,
22:04:36) <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>[GCC 4.4.3] on linux2<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Type "help",
"copyright", "credits" or "license" for more
information.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>> from ovirtsdk.api import API<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>> from ovirtsdk.xml import
params<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>> api =
API('http://192.168.1.181', 'admin@internal', '111111', None, None, '~/.spicec/ca.crt',
None, None, True)<o:p></o:p></span></p>
<p class=MsoNormal><b><span lang=EN-US>Traceback (most recent call last):<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File "<stdin>",
line 1, in <module><o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File "ovirtsdk/api.py",
line 107, in __init__<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> url='/api')<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File
"ovirtsdk/infrastructure/proxy.py", line 129, in request<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> last=last)<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File
"ovirtsdk/infrastructure/proxy.py", line 171, in __doRequest<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> return
params.parseString(response_body) if response_body is not None and
response_body is not '' \<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File
"ovirtsdk/xml/params.py", line 21229, in parseString<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US>
rootObj.build(rootNode)<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File
"ovirtsdk/xml/params.py", line 20304, in build<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US>
self.buildAttributes(node, node.attrib, [])<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File
"ovirtsdk/xml/params.py", line 20309, in buildAttributes<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> super(API,
self).buildAttributes(node, attrs, already_processed)<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File
"ovirtsdk/xml/params.py", line 4160, in buildAttributes<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> value =
find_attr_value_('xsi:type', node)<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> File "ovirtsdk/xml/params.py",
line 316, in find_attr_value_<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US> namespace =
node.nsmap.get(prefix)<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-US>AttributeError: nsmap</span></b><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>But, when I use it in python 2.7.3, it’s
ok<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>leaboy@leaboy:~/workspace/thtf-client$
python --version<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Python 2.7.3<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>leaboy@leaboy:~/workspace/thtf-client$
python<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Python 2.7.3 (default, Aug 1 2012,
05:16:07) <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>[GCC 4.6.3] on linux2<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Type "help",
"copyright", "credits" or "license" for more
information.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>> from ovirtsdk.api import API<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>> from ovirtsdk.xml import
params<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>> api =
API('http://192.168.1.181', 'admin@internal', '111111', None, None,
'~/.spicec/ca.crt', None, True)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>>>><o:p> </o:p></span></p>
</div>
</body>
</html>