Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TypeError: '<' not supported between instances of 'str' and 'int' #3214

Open
waldiTM opened this issue Sep 14, 2024 · 2 comments
Open
Assignees

Comments

@waldiTM
Copy link

waldiTM commented Sep 14, 2024

Describe the bug: A clear and concise description of what the bug is.

A lot of tests fail with invalid comparisions.

tests/pa/test_provision.py:26: in <module>
    from azurelinuxagent.common.protocol.util import OVF_FILE_NAME
azurelinuxagent/common/protocol/util.py:36: in <module>
    from azurelinuxagent.common.protocol.metadata_server_migration_util import cleanup_metadata_server_artifacts, \
azurelinuxagent/common/protocol/metadata_server_migration_util.py:25: in <module>
    from azurelinuxagent.common.event import add_event, WALAEventOperation
azurelinuxagent/common/event.py:620: in <module>
    __event_logger__ = EventLogger()
azurelinuxagent/common/event.py:372: in __init__
    osutil = get_osutil()
azurelinuxagent/common/osutil/factory.py:54: in get_osutil
    return _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name)
azurelinuxagent/common/osutil/factory.py:101: in _get_osutil
    if "sid" in distro_version or Version(distro_version) > Version("7"):
/usr/lib/python3/dist-packages/setuptools/_distutils/version.py:84: in __gt__
    c = self._cmp(other)
/usr/lib/python3/dist-packages/setuptools/_distutils/version.py:343: in _cmp
    if self.version < other.version:
E   TypeError: '<' not supported between instances of 'str' and 'int'
@narrieta narrieta self-assigned this Sep 16, 2024
@nagworld9
Copy link
Contributor

nagworld9 commented Dec 21, 2024

This issue is manifestation of distro.version contain invalid value 'n/a'. Debain owner confirmed me that this is only in daily builds, and they didn't update release version metadata in dev builds, so debain version pointed to 'n/a'. At some point closer to GA release, they told they will update package that supplies /etc/debian_version and the LSB metadata will be updated to return the release values. When that happens, distro.version return valid value like '13' etc..

For daily builds, they already have patch. So we don't need to fix as this is only in development builds and we shouldn't see in GA builds

import distro
distro.version()
'n/a'

nnandigam@lisa--069-e0-n0:/etc$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux trixie/sid
Release: n/a
Codename: trixie

@waldiTM
Copy link
Author

waldiTM commented Dec 23, 2024

I'm (one of) the owner of the Debian package. The value of n/a is completely valid for any state.

So, yes, this needs to be fixed for us to support this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants