Skip to content

Instantly share code, notes, and snippets.

@nvgoldin
Last active March 20, 2017 17:42
Show Gist options
  • Save nvgoldin/5c2664fd597a7400802cd445aebf9a32 to your computer and use it in GitHub Desktop.
Save nvgoldin/5c2664fd597a7400802cd445aebf9a32 to your computer and use it in GitHub Desktop.
sdk4 types init
In [1]: import ovirtsdk4 as sdk4
In [2]: sdk4.types
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-3ecb0c730dda> in <module>()
----> 1 sdk4.types
AttributeError: 'module' object has no attribute 'types'
In [3]: api = sdk4.Connection(url='https://engine/ovirt-engine/api', username='admin@internal', password='123', insecure=True, debug=True)
In [4]: sdk4.types
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-3ecb0c730dda> in <module>()
----> 1 sdk4.types
AttributeError: 'module' object has no attribute 'types'
In [5]: sdk4.types
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-3ecb0c730dda> in <module>()
----> 1 sdk4.types
AttributeError: 'module' object has no attribute 'types'
In [6]: api.test()
Out[6]: True
In [7]: sdk4.types
Out[7]: <module 'ovirtsdk4.types' from '/home/ngoldin/virtualenv/lago-venv/lib/python2.7/site-packages/ovirtsdk4/types.pyc'>
In [8]: # however
In [9]: api = sdk4.Connection(url='https://WRONGURL', username='admin@internal', password='123', insecure=True, debug=True)
In [10]: sdk4.types
Out[10]: <module 'ovirtsdk4.types' from '/home/ngoldin/virtualenv/lago-venv/lib/python2.7/site-packages/ovirtsdk4/types.pyc'>
In [1]: import ovirtsdk4 as sdk4
In [2]: api = sdk4.Connection(url='https://WRONGURL', username='admin@internal', password='123', insecure=True, debug=True)
In [3]: sdk4.types
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-3ecb0c730dda> in <module>()
----> 1 sdk4.types
AttributeError: 'module' object has no attribute 'types'
In [4]: api.test()
Out[4]: False
In [5]: sdk4.types
Out[5]: <module 'ovirtsdk4.types' from '/home/ngoldin/virtualenv/lago-venv/lib/python2.7/site-packages/ovirtsdk4/types.pyc'>
In [6]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment