Merge "Bump api_version from 1.35 to 1.36"
This commit is contained in:
@@ -31,7 +31,7 @@ if not LOG.handlers:
|
|||||||
HEADER_NAME = "OpenStack-API-Version"
|
HEADER_NAME = "OpenStack-API-Version"
|
||||||
SERVICE_TYPE = "container"
|
SERVICE_TYPE = "container"
|
||||||
MIN_API_VERSION = '1.1'
|
MIN_API_VERSION = '1.1'
|
||||||
MAX_API_VERSION = '1.35'
|
MAX_API_VERSION = '1.36'
|
||||||
DEFAULT_API_VERSION = '1.latest'
|
DEFAULT_API_VERSION = '1.latest'
|
||||||
|
|
||||||
_SUBSTITUTIONS = {}
|
_SUBSTITUTIONS = {}
|
||||||
|
@@ -26,7 +26,7 @@ CREATION_ATTRIBUTES = ['name', 'image', 'command', 'cpu', 'memory',
|
|||||||
'security_groups', 'hints', 'nets', 'auto_remove',
|
'security_groups', 'hints', 'nets', 'auto_remove',
|
||||||
'runtime', 'hostname', 'mounts', 'disk',
|
'runtime', 'hostname', 'mounts', 'disk',
|
||||||
'availability_zone', 'auto_heal', 'privileged',
|
'availability_zone', 'auto_heal', 'privileged',
|
||||||
'exposed_ports', 'healthcheck', 'registry']
|
'exposed_ports', 'healthcheck', 'registry', 'tty']
|
||||||
|
|
||||||
|
|
||||||
class Container(base.Resource):
|
class Container(base.Resource):
|
||||||
@@ -97,6 +97,7 @@ class ContainerManager(base.Manager):
|
|||||||
def create(self, **kwargs):
|
def create(self, **kwargs):
|
||||||
self._process_command(kwargs)
|
self._process_command(kwargs)
|
||||||
self._process_mounts(kwargs)
|
self._process_mounts(kwargs)
|
||||||
|
self._process_tty(kwargs)
|
||||||
|
|
||||||
new = {}
|
new = {}
|
||||||
for (key, value) in kwargs.items():
|
for (key, value) in kwargs.items():
|
||||||
@@ -121,6 +122,12 @@ class ContainerManager(base.Manager):
|
|||||||
if mount.get('type') == 'bind':
|
if mount.get('type') == 'bind':
|
||||||
mount['source'] = utils.encode_file_data(mount['source'])
|
mount['source'] = utils.encode_file_data(mount['source'])
|
||||||
|
|
||||||
|
def _process_tty(self, kwargs):
|
||||||
|
tty_microversion = api_versions.APIVersion("1.36")
|
||||||
|
if self.api_version >= tty_microversion:
|
||||||
|
if 'interactive' in kwargs and 'tty' not in kwargs:
|
||||||
|
kwargs['tty'] = kwargs['interactive']
|
||||||
|
|
||||||
def delete(self, id, **kwargs):
|
def delete(self, id, **kwargs):
|
||||||
return self._delete(self._path(id),
|
return self._delete(self._path(id),
|
||||||
qparams=kwargs)
|
qparams=kwargs)
|
||||||
@@ -179,6 +186,7 @@ class ContainerManager(base.Manager):
|
|||||||
def run(self, **kwargs):
|
def run(self, **kwargs):
|
||||||
self._process_command(kwargs)
|
self._process_command(kwargs)
|
||||||
self._process_mounts(kwargs)
|
self._process_mounts(kwargs)
|
||||||
|
self._process_tty(kwargs)
|
||||||
|
|
||||||
if not set(kwargs).issubset(CREATION_ATTRIBUTES):
|
if not set(kwargs).issubset(CREATION_ATTRIBUTES):
|
||||||
raise exceptions.InvalidAttribute(
|
raise exceptions.InvalidAttribute(
|
||||||
|
Reference in New Issue
Block a user