| Summary: | "UserWarnings" outputted during api.hosts.get() | ||
|---|---|---|---|
| Product: | [oVirt] ovirt-engine-sdk-python | Reporter: | jniederm |
| Component: | Core | Assignee: | Juan Hernández <juan.hernandez> |
| Status: | CLOSED WONTFIX | QA Contact: | Pavel Stehlik <pstehlik> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.6.3.0 | CC: | bugs |
| Target Milestone: | --- | Flags: | rule-engine:
planning_ack?
rule-engine: devel_ack? rule-engine: testing_ack? |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-02-23 17:44:40 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
One of the changes that was done in the master branch of the Python SDK was the upgrade of the "generateDS.py" tool used to generate Python code from the XML schema, from 2.12a to 2.15b. One of the improvements of 2.15b is that it validates the values of enumerated types received from the server. In this particular case it is validating the values of the enumerated types used for statistics, and it is detecting that the values are lower case, instead of upper case, as described by the XML schema. This happens only when adding the host because the statistics are only reported in certain situations, like when adding the host, or when using the "All-Content: true" header. Anyhow, the Python SDK for version 4 of the API is undergoing big changes, which will make this issue irrelevant (one of those changes is that we will stop using generateDS.py). I suggest that you stop using the SDK from the master branch, and use instead the one from the 3.6 branch. The engine already supports versions 3 and 4 of the API, and the latest realease of the 3.6 SDK (3.6.3.0) automatically and explicitly selects version 3 of the API. |
Description of problem: Following warnings are outputted during api.hosts.get(id=<hostId>) call. /usr/lib/python2.7/site-packages/ovirtsdk/xml/params.py:46773: UserWarning: Value "gauge" does not match xsd enumeration restriction on StatisticKind warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on StatisticKind' % {"value" : value.encode("utf-8")} ) /usr/lib/python2.7/site-packages/ovirtsdk/xml/params.py:46785: UserWarning: Value "integer" does not match xsd enumeration restriction on ValueType warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ValueType' % {"value" : value.encode("utf-8")} ) /usr/lib/python2.7/site-packages/ovirtsdk/xml/params.py:46797: UserWarning: Value "bytes" does not match xsd enumeration restriction on StatisticUnit warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on StatisticUnit' % {"value" : value.encode("utf-8")} ) /usr/lib/python2.7/site-packages/ovirtsdk/xml/params.py:46785: UserWarning: Value "decimal" does not match xsd enumeration restriction on ValueType warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ValueType' % {"value" : value.encode("utf-8")} ) /usr/lib/python2.7/site-packages/ovirtsdk/xml/params.py:46797: UserWarning: Value "percent" does not match xsd enumeration restriction on StatisticUnit warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on StatisticUnit' % {"value" : value.encode("utf-8")} ) /usr/lib/python2.7/site-packages/ovirtsdk/xml/params.py:46797: UserWarning: Value "none" does not match xsd enumeration restriction on StatisticUnit warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on StatisticUnit' % {"value" : value.encode("utf-8")} ) Version-Release number of selected component (if applicable): ovirt-engine-sdk-python.noarch 4.0.0.0-0.2.20151123.git8ba204b.fc22 @ovirt-master-snapshot engine: self-build, 4.0 master, 904ab61 master (it differs from bugzilla version field because appropriate version was not offered) How reproducible: 100% when host is freshly added, 0% when host is in state 'up' Steps to Reproduce: def createHost(api, name, ipAddress): print 'Creating host' host = api.hosts.get(name) if host is None: host = api.hosts.add(params.Host( name=name, cluster=api.clusters.get(name='Default'), address=ipAddress, root_password='a')) print 'Host created' else: print 'Host already exists' while not (host.get_status().state == 'up'): print 'host status: %s' % host.get_status().state time.sleep(1) host = api.hosts.get(id=host.id) # <-------------------------- print 'host status: %s' % host.get_status().state return host Actual results: warning printed Expected results: no warnings printed Additional info: in worked ok in 3.6