update request for start_container, it doesn't send data any more
@@ -387,6 +387,12 @@ class DockerContainerDriver(ContainerDriver):
data = json.dumps(payload)
if start:
+ if float(self._get_api_version()) > 1.22:
+ result = self.connection.request(
+ '/v%s/containers/%s/start' %
+ (self.version, id_),
+ method='POST')
+ else:
result = self.connection.request(
'/v%s/containers/%s/start' %
(self.version, id_), data=data,
@@ -418,6 +424,12 @@ class DockerContainerDriver(ContainerDriver):
:return: The container refreshed with current data
:rtype: :class:`libcloud.container.base.Container`
"""
+ if float(self._get_api_version()) > 1.22:
+ result = self.connection.request(
+ '/v%s/containers/%s/start' %
+ (self.version, container.id),
+ method='POST')
+ else:
payload = {
'Binds': [],
'PublishAllPorts': True,
@@ -427,6 +439,7 @@ class DockerContainerDriver(ContainerDriver):
'/v%s/containers/%s/start' %
(self.version, container.id),
method='POST', data=data)
+
if result.status in VALID_RESPONSE_CODES:
return self.get_container(container.id)
else:
