# Traceback in azure\_rm.py on Centos 7.3 with Azure python SDK rc6

**URL:** <https://forum.ansible.com/t/traceback-in-azure-rm-py-on-centos-7-3-with-azure-python-sdk-rc6/23250>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [December 13, 2016, 9:41pm UTC](https://forum.ansible.com/t/traceback-in-azure-rm-py-on-centos-7-3-with-azure-python-sdk-rc6/23250 "2016-12-13T21:41:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Moreno](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jose\_Moreno](https://forum.ansible.com/u/Jose_Moreno)\
**Post date:** [December 13, 2016, 9:41pm UTC](https://forum.ansible.com/t/traceback-in-azure-rm-py-on-centos-7-3-with-azure-python-sdk-rc6/23250/1 "2016-12-13T21:41:19Z")

</div>

Hi there,

I am trying to install Ansible on a clean, yum-updated CentOS 7.3 machine with the Azure modules, but azure\_rm.py refuses to work. I installed the Azure SDK version rc6, and I could not spot any error. I am using file based authentication (~/.azure/credentials), with a file that works in another host. However, azure\_rm.py will break:

[jose@vm-00 ~]$ python ./ansible/contrib/inventory/azure\_rm.py --list  
Traceback (most recent call last):  
File “./ansible/contrib/inventory/azure\_rm.py”, line 205, in   
from azure.common.credentials import ServicePrincipalCredentials, UserPassCredentials  
File “/usr/lib/python2.7/site-packages/azure/common/credentials.py”, line 28, in   
from msrestazure.azure\_active\_directory import (  
File “/usr/lib/python2.7/site-packages/msrestazure/azure\_active\_directory.py”, line 35, in   
import keyring  
File “/usr/lib/python2.7/site-packages/keyring/ **init**.py”, line 6, in   
from .core import (set\_keyring, get\_keyring, set\_password, get\_password,  
File “/usr/lib/python2.7/site-packages/keyring/core.py”, line 149, in   
init\_backend()  
File “/usr/lib/python2.7/site-packages/keyring/core.py”, line 65, in init\_backend  
keyrings = filter(limit, backend.get\_all\_keyring())  
File “/usr/lib/python2.7/site-packages/keyring/util/ **init**.py”, line 20, in wrapper  
func.always\_returns = func(\*args, \*\*kwargs)  
File “/usr/lib/python2.7/site-packages/keyring/backend.py”, line 179, in get\_all\_keyring  
\_load\_backends()  
File “/usr/lib/python2.7/site-packages/keyring/backend.py”, line 139, in \_load\_backends  
list(map(\_load\_backend, backends))  
File “/usr/lib/python2.7/site-packages/keyring/backend.py”, line 131, in \_load\_backend  
mod = importlib.import\_module(‘.’+name, package)  
File “/usr/lib64/python2.7/importlib/ **init**.py”, line 37, in import\_module  
**import** (name)  
File “/usr/lib/python2.7/site-packages/keyring/backends/SecretService.py”, line 9, in   
import secretstorage  
File “/usr/lib/python2.7/site-packages/secretstorage/ **init**.py”, line 14, in   
from secretstorage.collection import Collection, create\_collection,   
File “/usr/lib/python2.7/site-packages/secretstorage/collection.py”, line 21, in   
from secretstorage.item import Item  
File “/usr/lib/python2.7/site-packages/secretstorage/item.py”, line 15, in   
from secretstorage.util import InterfaceWrapper, bus\_get\_object,   
File “/usr/lib/python2.7/site-packages/secretstorage/util.py”, line 14, in   
from secretstorage.dhcrypto import Session, int\_to\_bytes  
File “/usr/lib/python2.7/site-packages/secretstorage/dhcrypto.py”, line 36, in   
DH\_PRIME\_1024 = int\_from\_bytes(bytearray(DH\_PRIME\_1024\_BYTES), ‘big’)  
File “/usr/lib64/python2.7/site-packages/cryptography/utils.py”, line 50, in int\_from\_bytes  
return int(data.encode(‘hex’), 16)  
AttributeError: ‘bytearray’ object has no attribute ‘encode’

Any idea what is missing?

Thanks!

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [December 14, 2016, 7:09pm UTC](https://forum.ansible.com/t/traceback-in-azure-rm-py-on-centos-7-3-with-azure-python-sdk-rc6/23250/2 "2016-12-14T19:09:44Z")

</div>

The doc is pretty clear about the supported Azure version beeting 2.0.0rc5. The python modules for Azure har unfortunately known for breaking changes betweens minor versions, so there’s no way the Ansible modules will keep up with all the changes. Solution: Uninstall your current packages, and install 2.0.0rc5. rc5 has some include issues so you probably have to manually add some extra packages, but errors about that should be surfaced by Ansible. You can also manually verify by starting up python and try to import a module such as:  
import msrestazure.azure\_exceptions
