david-caro / python-foreman

Small low level python wrapper around Foreman API
GNU General Public License v2.0
57 stars 37 forks source link

'Foreman' object has no attribute 'lifecycle_environments' #98

Open achevalet opened 4 years ago

achevalet commented 4 years ago

I'm trying to manage lifecycle environments from katello plugins and I'm not sure what's going wrong.. The 'lifecycle_environments' is present in the definitions retrieved from the running foreman instance but there is no attribute for it:

>>> from foreman.client import Foreman
>>> fm = Foreman('https://foreman.com', ('admin','password'), api_version=2, use_cache=False, strict_cache=True)
>>> defs = fm._get_remote_defs()
>>> print defs["docs"]["resources"]["lifecycle_environments"]
{u'api_url': u'/api', u'deprecated': False, u'metadata': None, u'full_description': u'\n<p># Description</p>\n\n<p>An environment is a basic organization structure that groups hosts,\nproducts, repositories, etc.
.....

>>> fm.lifecycle_environments
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Foreman' object has no attribute 'lifecycle_environments'