Make azure-mgmt-resource work with requests 2.11.x. We should update the azure python packages, however, that is a much bigger effort. This is needed to make sure nixops keeps working with Azure.

(cherry picked from commit 81f2bde0a2)
This commit is contained in:
Rob Vermaas 2017-02-12 09:10:35 +00:00
parent 0688fdfc05
commit c07f1589bf
No known key found for this signature in database
GPG Key ID: E114A5F264A8AE8E

View File

@ -1762,6 +1762,11 @@ in {
url = mirror://pypi/a/azure-mgmt-resource/azure-mgmt-resource-0.20.1.zip;
sha256 = "0slh9qfm5nfacrdm3lid0sr8kwqzgxvrwf27laf9v38kylkfqvml";
};
preConfigure = ''
# Patch to make this package work on requests >= 2.11.x
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/resource/resourcemanagement.py
'';
postInstall = ''
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py