devopshq / teamcity

dohq-teamcity is a Python package providing access to the JetBrains TeamCity server API.
https://devopshq.github.io/teamcity/
MIT License
33 stars 12 forks source link

Build.get_root/get_children throws "'dohq_teamcity.models.file' has no attribute 'swagger_types'" #25

Closed kapsh closed 3 years ago

kapsh commented 4 years ago

Reproducible example (using https://teamcity.jetbrains.com/viewType.html?buildTypeId=DemoProjects_TeamCity_Net_Build for build having artifacts):

import dohq_teamcity

teamcity = dohq_teamcity.TeamCity("https://teamcity.jetbrains.com/guestAuth", auth=None)
build = teamcity.builds.get("buildType:(id:DemoProjects_TeamCity_Net_Build),number:8")
build.get_root()

Result:

AttributeError: module 'dohq_teamcity.models.file' has no attribute 'swagger_types'

Expected: Files instance returned.

It works when monkey-patched by assigning dohq_teamcity.custom.models.file = dohq_teamcity.models.File, so it's likely that star imports gone wrong somewhere.