Skip to content

get_version() parses a <prefix> element that does not exist in the UDS API #35

Description

@bandrel

Summary

get_version() parses a <prefix> element out of the /cucm-uds/version response, and main() prints it to the operator. UDS has no <prefix> element. The string "prefix" does not appear anywhere in Cisco's UDS documentation — not the current /docs/ reference, not the legacy /site/ API reference, not the developer guide.

The complete documented response is:

<versionInformation uri="https://{host}/cucm-uds/version" version="10.0.0">
  <version>11.5.1</version>
  <capabilities>
    <usersResourceAuthEnabled>true</usersResourceAuthEnabled>
  </capabilities>
</versionInformation>

That is the entire element list: <versionInformation> with uri and version attributes, <version>, and <capabilities><usersResourceAuthEnabled>.

Effect

info['prefix'] is never populated against a real cluster, so the operator-facing print at thief.py:2932 is permanently dead. It is only ever populated by the _TEST_MODE stub ('prefix': '11.0(1)'), which means any test asserting on it is asserting on a fiction and gives false confidence that the field works.

Fix

Drop prefix from the parse loop, from the _TEST_MODE dict, and from the main() output. If the intent was to surface the wrapper's version attribute (the UDS schema version, e.g. 10.0.0, distinct from the CUCM version in the <version> element), that is a genuinely useful thing to report and would be worth parsing under an accurate name — but it is an attribute on <versionInformation>, not a child element.

Second, real version-dependency in the same function

<capabilities> was introduced in 11.5(1). The legacy CUCM 10.x reference documents the response with no <capabilities> block at all. The current code handles this correctly by accident — the auth_m regex simply does not match and usersAuthRequired stays absent from the dict, so version_info.get('usersAuthRequired') is falsey. That is the right behavior, but it is undocumented and one refactor away from becoming a KeyError. Worth a comment stating that a missing flag means "pre-11.5(1), auth not enforceable" rather than "unknown".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions