StratusLab / client

Command Line Interface (CLI) for StratusLab cloud services
Apache License 2.0
2 stars 1 forks source link

accounting script unit tests are failing #132

Closed loomis closed 10 years ago

loomis commented 10 years ago

This commit c86fd5b47c2184149b08117418437963a94e951d broke the client build on CentOS. The error message is:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/build_client_centos/api/code/src/test/python/accounting/OneQueryTest.py", line 41, in test_get_all_vms_from_one
    assert isinstance(user_vm_etree, ET.Element)
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

and

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/build_client_centos/api/code/src/test/python/accounting/OneQueryTest.py", line 23, in test_user_vms_dict2et
    assert isinstance(user_vm_etree, ET.Element)
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

This is because in Python 2.6.6 (default on CentOS) ET.Element is a function, not a type or class.

[jenkins@onevm-104 build_client_centos]$ python 
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.etree.ElementTree as ET
>>> type(ET.Element)
<type 'function'>
konstan commented 10 years ago

I look into this asap. On May 20, 2014 7:33 PM, "Charles (Cal) Loomis" notifications@github.com wrote:

This commit c86fd5bhttps://github.com/StratusLab/client/commit/c86fd5b47c2184149b08117418437963a94e951dbroke the client build on CentOS. The error message is:

Traceback (most recent call last): File "/var/lib/jenkins/workspace/build_client_centos/api/code/src/test/python/accounting/OneQueryTest.py", line 41, in test_get_all_vms_from_one assert isinstance(user_vm_etree, ET.Element) TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

and

Traceback (most recent call last): File "/var/lib/jenkins/workspace/build_client_centos/api/code/src/test/python/accounting/OneQueryTest.py", line 23, in test_user_vms_dict2et assert isinstance(user_vm_etree, ET.Element) TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

This is because in Python 2.6.6 (default on CentOS) ET.Element is a function, not a type or class.

[jenkins@onevm-104 build_client_centos]$ python Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import xml.etree.ElementTree as ET type(ET.Element) <type 'function'>

— Reply to this email directly or view it on GitHubhttps://github.com/StratusLab/client/issues/132 .