nova/virt/disk/api.py imports crypt, doesn't work on Windows

Bug #1034043 reported by Alessandro Pilotti
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Alessandro Pilotti

Bug Description

At line 28:

import crypt

breaks Windows compatibility.

The crypt module is used only in _set_passwd (line 498).

I'd suggest to move the import there or to do a conditional import, like in the attached diff.

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :
Revision history for this message
Russell Bryant (russellb) wrote :

It looks like the usage of crypt is pretty basic. We should be able to change to something else that is compatible.

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

In the meantime, can we just commit the simple os based fix proposed in the previous comment?

It's a blocking issue for nova compute on Windows.

Thanks

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/12939

Changed in nova:
assignee: nobody → Alessandro Pilotti (alexpilotti)
status: Confirmed → In Progress
Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12939
Committed: http://github.com/openstack/nova/commit/918a02d5cc3c845bcd58e00fcdf2728e78dafa26
Submitter: Jenkins
Branch: master

commit 918a02d5cc3c845bcd58e00fcdf2728e78dafa26
Author: Alessandro Pilotti <email address hidden>
Date: Thu Sep 13 15:08:45 2012 +0300

    Fixes import issue on Windows

    Fixes Bug #1034043

    The crypt module is not available on Windows.
    Since this is a blocking issue on Hyper-V and since the only
    function using it is _set_passwd (not implemented on Windows),
    the import can be safely conditionally avoided.

    Change-Id: Iefe97edcfcff3b70593e07628b6a6f85e680cbc7

Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.