virt-manager/eae7dc06-fix-URL-installs-when-content-length-header-missing.patch

26 lines
954 B
Diff
Raw Normal View History

Subject: urlfetcher: Fix URL installs when content-length header missing
From: Cole Robinson crobinso@redhat.com Tue Jan 12 12:45:02 2016 -0500
Date: Tue Jan 12 12:45:02 2016 -0500:
Git: eae7dc061968a83fef8ebb632c8f939621ff22b1
Suggested-by: bduff@sjm.com
Index: virt-manager-1.3.2/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.3.2.orig/virtinst/urlfetcher.py
+++ virt-manager-1.3.2/virtinst/urlfetcher.py
@@ -186,8 +186,11 @@ class _HTTPURLFetcher(_URLFetcher):
"""
response = requests.get(url, stream=True)
response.raise_for_status()
- size = response.headers.get('content-length')
- return response, size.isdigit() and int(size) or None
+ try:
+ size = int(response.headers.get('content-length'))
+ except:
+ size = None
+ return response, size
def _write(self, urlobj, fileobj):
"""