xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

No module named cryptography.hazmat.backends #167

Open kcgthb opened 5 years ago

kcgthb commented 5 years ago

Fresh install of xcat-inventory 0.1.6 on RHEL/CentOS 7.6:

# yum install https://github.com/xcat2/xcat-inventory/releases/download/v0.1.6/xcat-inventory-0.1.6-c0.noarch.rpm
[...]
==================================================================================================================================================================================
 Package                                    Arch                            Version                                Repository                                                Size
==================================================================================================================================================================================
Updating:
 xcat-inventory                             noarch                          1:0.1.6-c0                             /xcat-inventory-0.1.6-c0.noarch                          327 k
Installing for dependencies:
 python-babel                               noarch                          0.9.6-8.el7                            base                                                     1.4 M
 python-jinja2                              noarch                          2.7.2-2.el7                            base                                                     515 k
 python-markupsafe                          x86_64                          0.11-10.el7                            base                                                      25 k

Transaction Summary
==================================================================================================================================================================================
Install             ( 3 Dependent packages)
Upgrade  1 Package
[...]

# xcat-inventory -V
No module named cryptography.hazmat.backends

# rpm -q xcat-inventory
xcat-inventory-0.1.6-c0.noarch
kcgthb commented 5 years ago

That's a missing dependency on python-cryptography. Installing that package solves the problem.

tingtli commented 5 years ago

@kcgthb Would you please let us know your os version. thanks!

kcgthb commented 5 years ago

Sure: as mentioned in the first message, it's CentOS 7.6.

tingtli commented 5 years ago

@kcgthb I didn't hit your issue on my environment. this is what I did on rhels7.6. It can work without python-cryptography

  1. [root@c910f04x12v02 ~]# yum install https://github.com/xcat2/xcat-inventory/releases/download/v0.1.6/xcat-inventory-0.1.6-c0.noarch.rpm
  2. [root@c910f04x12v02 ~]# pip install pymysql
  3. [root@c910f04x12v02 ~]# xcat-inventory -V
    0.1.6 (git commit fe6900cc38a6fa8f2329ad901b14354835561c6e)
  4. [root@c910f04x12v02 ~]# rpm -qa |grep -i python-cryptography
    [root@c910f04x12v02 ~]#

by the way, what is your python version. my version is python 2.7.5

immarvin commented 5 years ago

HI @kcgthb , glad to here that you are trying xcat-inventory

thanks for your reporting this dependency issue, we will take a look at it and add python-cryptography into rpm spec if necessary.

I would like to give a forenotice here, there will be 2 WOW features coming soon:

  1. the native capability to source control xcat cluster configuration data(integrated git as the backend source control system) will coming with next xcat-inventory release(v0.1.7)
  2. an "Infrastructure as code" way to deploy the cluster, users only need to define the cluster definition in yaml file and xcat-inventory will complete the cluster deployment according to the specified cluster definition automatically. the design of this feature is already completed, will coming with the next 1-2 xcat-inventory release
kcgthb commented 5 years ago

@tingtli and @immarvin Thanks! Yes, I think adding python-cryptography as a dependency in the RPM spec would be good. I'm using the stock Python from the OS, that is, 2.7.5.

And great to hear about the upcoming features!

tingtli commented 5 years ago

double check on my test environment. I think when I run pip install pymysql, a package named cryptography is Installed. pymysql is installed because xcat-inventory prompt that pymysql is not installed.

[root@c910f04x12v02 ~]# pip search cryptography
cryptography (2.4.2)                   - cryptography is a package which provides cryptographic recipes and primitives to