From 6c201e63ea76032cbdd65211382b6266e6a767de Mon Sep 17 00:00:00 2001 From: Alessandro Pilotti Date: Thu, 15 Nov 2012 20:25:26 +0200 Subject: [PATCH] Fixes bug on Windows related to a wrong API url Fixes Bug #1079323 python-glanceclient (latest repository code) fails on Windows due to a malformed API url. This error is due to the usage of os.path.normpath(), which should not be used for URLs as it swaps "/" with "\" on Windows. The fix consists in using posixpath.normpath(). Please see also https://bugs.launchpad.net/nova/+bug/1077125 and related commit. Change-Id: Iaa643bd579963ad9ffbf10674973cbca75d435ac --- glanceclient/common/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index cb514a9..8915107 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -16,7 +16,7 @@ import copy import httplib import logging -import os +import posixpath import socket import StringIO import struct @@ -142,7 +142,7 @@ class HTTPClient(object): conn = self.get_connection() try: - conn_url = os.path.normpath('%s/%s' % (self.endpoint_path, url)) + conn_url = posixpath.normpath('%s/%s' % (self.endpoint_path, url)) if kwargs['headers'].get('Transfer-Encoding') == 'chunked': conn.putrequest(method, conn_url) for header, value in kwargs['headers'].items():