Refactor http request/response logging

Using the --debug flag or the GLANCECLIENT_DEBUG env var, a user will
see http requests and responses in great detail. Requests are formed
into proper curl commands while responses are printed just as they would
as if the curl request provided were executed. Response bodies will not
be printed if they are application/octet-stream.

Change-Id: I9c9c5d6ec9f481091c944e596d073da3739795b6
This commit is contained in:
Brian Waldon
2012-07-29 22:12:37 -07:00
parent 158f7ccd74
commit 6c8e0342c0
3 changed files with 38 additions and 33 deletions
-5
View File
@@ -13,16 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from glanceclient.common import http
from glanceclient.v1 import images
from glanceclient.v1 import image_members
logger = logging.getLogger(__name__)
class Client(http.HTTPClient):
"""Client for the OpenStack Images v1 API.