schubergphilis / towerlib

A python library to interface with ansible tower's (awx) api.
MIT License
43 stars 39 forks source link

AttributeError: 'Tower' object has no attribute 'get_inventory_by_name' #93

Closed ningen1 closed 3 years ago

ningen1 commented 3 years ago

Hello, i was trying to follow https://towerlib.readthedocs.io/en/latest/usage.html i did not try all the examples, but the ones i tried were working fine, except for # or inventory = tower.get_inventory_by_name('inventory_name') AttributeError: 'Tower' object has no attribute 'get_inventory_by_name'

phospi commented 3 years ago

Hi,

yep, documentation is a bit outdated. You have to use organization

organization = tower.get_organization_by_name("Default")
inventory = organization.get_inventory_by_name("My Inventory")
costastf commented 3 years ago

Thanks @phospi for reporting this and @ningen1 for answering this. I guess this is a great time to mention that any help with the project, like say, updating the documentation, would be greatly appreciated ☺️