Make azure-mgmt-... 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.

This commit is contained in:
Rob Vermaas 2017-02-12 09:23:52 +00:00
parent 81f2bde0a2
commit 4eb92c5c64
No known key found for this signature in database
GPG Key ID: E114A5F264A8AE8E

View File

@ -1489,6 +1489,11 @@ in modules // {
url = mirror://pypi/a/azure-mgmt-compute/azure-mgmt-compute-0.20.0.zip;
sha256 = "12hr5vxdg2sk2fzr608a37f4i8nbchca7dgdmly2w5fc7x88jx2v";
};
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/compute/computemanagement.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
@ -1509,6 +1514,11 @@ in modules // {
url = mirror://pypi/a/azure-mgmt-network/azure-mgmt-network-0.20.1.zip;
sha256 = "10vj22h6nxpw0qpvib5x2g6qs5j8z31142icvh4qk8k40fcrs9hx";
};
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/network/networkresourceprovider.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
@ -1570,6 +1580,11 @@ in modules // {
url = mirror://pypi/a/azure-mgmt-storage/azure-mgmt-storage-0.20.0.zip;
sha256 = "16iw7hqhq97vlzfwixarfnirc60l5mz951p57brpcwyylphl3yim";
};
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/storage/storagemanagement.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