Use the system key tool to manually encrypt sensitive configuration value for Opscenter. When manually encrypting a configuration value you may see error below.  Check the Python configuration on your system. Ensure Pycrypto module is installed.

ERROR:

# /usr/share/opscenter/bin/opscenter_system_key_tool create ECB 128
Traceback (most recent call last):
………..
File “/usr/share/opscenter/lib/py/cassandra/metadata.py”, line 32, in <module>
import cassandra.cqltypes as types
File “/usr/share/opscenter/lib/py/cassandra/cqltypes.py”, line 44, in <module>
from six.moves import range
ImportError: cannot import name range

Checking Installation:

# yum install gmp-devel
……….
Package 1:gmp-devel-6.0.0-12.el7_1.x86_64 already installed and latest version
Nothing to do
# pip install pycrypto
Requirement already satisfied (use –upgrade to upgrade): pycrypto in …….
# pip install pycrypto —upgrade
Requirement already up-to-date: pycrypto in /usr/lib64/python2.7/site-packages

Solution:

The tool is failing on a python import of the six.moves module.

# pip install six
Requirement already satisfied (use –upgrade to upgrade): six in /usr/lib/python2.7/site-packages

# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
>>> import sys
>>> import six
>>> sys.version
‘2.7.5 (default, Nov 20 2015, 02:00:19) \n[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]’
>>> six.__version__
‘1.3.0’

# pip install six –upgrade
Collecting six
Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six
Found existing installation: six 1.3.0
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.3.0:
Successfully uninstalled six-1.3.0
Successfully installed six-1.10.0

Worked after upgrade:
/usr/share/opscenter/bin/opscenter_system_key_tool create ECB 128

Advertisements