summaryrefslogtreecommitdiff
path: root/swiftclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-01-10 03:42:45 +0000
committerGerrit Code Review <review@openstack.org>2015-01-10 03:42:45 +0000
commit7709fea51e71084163cf56c4d11a280ca4388357 (patch)
tree5c82df0b10612ce416a26e7110a6f074ccc00c13 /swiftclient
parent488272ee590364128741af3e5f84eebc0db4b19b (diff)
parent68f271aae2c45cd65d5a93659a812f9b8e823212 (diff)
downloadpython-swiftclient-7709fea51e71084163cf56c4d11a280ca4388357.tar.gz
Merge "Check that content_type header exists before using"
Diffstat (limited to 'swiftclient')
-rw-r--r--swiftclient/service.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/swiftclient/service.py b/swiftclient/service.py
index dddb7db..df1ffb3 100644
--- a/swiftclient/service.py
+++ b/swiftclient/service.py
@@ -1012,7 +1012,8 @@ class SwiftService(object):
try:
no_file = options['no_download']
content_type = headers.get('content-type')
- if content_type.split(';', 1)[0] == 'text/directory':
+ if (content_type and
+ content_type.split(';', 1)[0] == 'text/directory'):
make_dir = not no_file and out_file != "-"
if make_dir and not isdir(path):
mkdirs(path)