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

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

Closed
kapsh opened this issue Sep 13, 2020 · 0 comments · Fixed by #38
Assignees
Labels
bug Something isn't working

Comments

@kapsh
Copy link

kapsh commented Sep 13, 2020

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.

@Tim55667757 Tim55667757 added the bug Something isn't working label Sep 15, 2020
DenKoren added a commit to DenKoren/teamcity that referenced this issue Sep 7, 2021
Rename 'file' and 'files' definitions to 'File' and 'Files'.
The lowercase name caused python to mix model declaration and python
module name. As a result, deserializer got 'file' module as 'klass'
argument instead of File model definition.
This caused attribute error exception in deserializer.

fixes devopshq#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

6 participants