summaryrefslogtreecommitdiff
path: root/swift/common/base_storage_server.py
diff options
context:
space:
mode:
authorMahati Chamarthy <mahati.chamarthy@gmail.com>2015-01-28 22:29:22 +0530
committerMahati Chamarthy <mahati.chamarthy@gmail.com>2015-01-30 00:25:28 +0530
commitc8f02a88740183d449376fc2d8a1befb7aa7a5a7 (patch)
tree7c8762752f29129c7f2ebd3494e282d6d7422ad4 /swift/common/base_storage_server.py
parent13f529ca81b8e0a3729e0dd6f6c116396f642fd9 (diff)
downloadswift-c8f02a88740183d449376fc2d8a1befb7aa7a5a7.tar.gz
Add server type in OPTIONS response
Change-Id: I731872eaf2c878476525aa05fd60b9121be43e29
Diffstat (limited to 'swift/common/base_storage_server.py')
-rw-r--r--swift/common/base_storage_server.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/swift/common/base_storage_server.py b/swift/common/base_storage_server.py
index 4eb024b27..f7b4be8ea 100644
--- a/swift/common/base_storage_server.py
+++ b/swift/common/base_storage_server.py
@@ -14,6 +14,7 @@
# limitations under the License.
import inspect
+from swift import __version__ as swift_version
from swift.common.utils import public, timing_stats, config_true_value
from swift.common.swob import Response
@@ -31,6 +32,11 @@ class BaseStorageServer(object):
self.replication_server = replication_server
@property
+ def server_type(self):
+ raise NotImplementedError(
+ 'Storage nodes have not implemented the Server type.')
+
+ @property
def allowed_methods(self):
if self._allowed_methods is None:
self._allowed_methods = []
@@ -64,7 +70,8 @@ class BaseStorageServer(object):
:returns: swob.Response object
"""
# Prepare the default response
- headers = {'Allow': ', '.join(self.allowed_methods)}
+ headers = {'Allow': ', '.join(self.allowed_methods),
+ 'Server': '%s/%s' % (self.server_type, swift_version)}
resp = Response(status=200, request=req, headers=headers)
return resp