Description of problem: $ sudo pulp-admin -u admin -p admin repo create --id=tfoo --feed=local:blah /home/pkilambi/code/pulp/src/pulp/client/credentials.py:21: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha as SHA We should not default to sha imports anymore. Newer versions of python enforce use of hashlib. We need a try except to use hashlib by default and if that fails use sha. something like: try: import hashlib except ImportError: import sha class hashlib: @staticmethod def new(checksum): if checksum == 'sha': return sha.new() and the code would invoke it as hashlib.new('sha')
Since pulp packages require hashlib and we already import directly and use in other places, I simply replaced sha with hashlib. Fixed: 0b2f7aaa4e2176997789dd20e615de8d728abfba This can be tested by creating/deleting a consumer and noting the consumer cert, key, pulp.rep are cleaned up.
Fixed in 0.134.
[root@preethi ~]# rpm -q pulp pulp-0.0.134-1.fc14.noarch [root@preethi ~]# pulp-admin -u admin -p admin repo create --id=tfoo --feed=local:blah Successfully created repository [ tfoo ]
I still see this in the f13 pulp-server fails-qa [root@pulp-qe ~]# rpm -q pulp pulp-0.0.134-1.fc13.noarch [root@pulp-qe ~]# pulp-admin -u admin -p admin repo create --id=tfoo --feed=local:blah /usr/lib/python2.6/site-packages/pulp/client/credentials.py:21: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha as SHA Successfully created repository [ tfoo ]
The fix is on master but must have missed the 0.134 build. Perhaps I forget to push? Anyway, it really should be in 0.135 - putting back to MODIFIED.
verified [root@pulp-qe ~]# rpm -q pulp pulp-0.0.135-1.fc13.noarch [root@pulp-qe ~]# pulp-admin -u admin -p admin repo create --id=testfoo --feed=local:blah checked the /usr/lib/python2.6/site-packages/pulp/client/credentials.py:21: import hashlib
Closing with Community Release 15 pulp-0.0.223-4.