Merge "Revert "Add scheduler hint for zunclient""

This commit is contained in:
Jenkins
2017-05-30 03:38:25 +00:00
committed by Gerrit Code Review
3 changed files with 1 additions and 42 deletions

View File

@@ -112,13 +112,6 @@ class CreateContainer(command.ShowOne):
metavar='<command>',
nargs=argparse.REMAINDER,
help='Send command to the container')
parser.add_argument(
'--hint',
metavar='key=value',
action='append',
default=[],
help='Container hint key/value pairs for scheduler to select'
' host. May be used multiple times.')
return parser
def take_action(self, parsed_args):
@@ -141,9 +134,6 @@ class CreateContainer(command.ShowOne):
if parsed_args.interactive:
opts['interactive'] = True
hints = zun_utils.format_args(parsed_args.hint)
opts['hint'] = hints
opts = zun_utils.remove_null_parms(**opts)
container = client.containers.create(**opts)
columns = _container_columns(container)
@@ -586,13 +576,6 @@ class RunContainer(command.ShowOne):
metavar='<command>',
nargs=argparse.REMAINDER,
help='Send command to the container')
parser.add_argument(
'--hint',
metavar='key=value',
action='append',
default=[],
help='Container hint key/value pairs for scheduler to select'
' host. May be used multiple times.')
return parser
def take_action(self, parsed_args):
@@ -615,9 +598,6 @@ class RunContainer(command.ShowOne):
if parsed_args.interactive:
opts['interactive'] = True
hints = zun_utils.format_args(parsed_args.hint)
opts['hint'] = hints
opts = zun_utils.remove_null_parms(**opts)
container = client.containers.run(**opts)
columns = _container_columns(container)

View File

@@ -21,8 +21,7 @@ from zunclient import exceptions
CREATION_ATTRIBUTES = ['name', 'image', 'command', 'cpu', 'memory',
'environment', 'workdir', 'labels', 'image_pull_policy',
'restart_policy', 'interactive', 'image_driver',
'hint']
'restart_policy', 'interactive', 'image_driver']
class Container(base.Resource):

View File

@@ -85,12 +85,6 @@ def _show_container(container):
metavar='<command>',
nargs=argparse.REMAINDER,
help='Send command to the container')
@utils.arg('--hint',
action='append',
default=[],
metavar='<key=value>',
help='Container hint key/value pairs for scheduler to select'
' host. May be used multiple times.')
def do_create(cs, args):
"""Create a container."""
opts = {}
@@ -103,10 +97,6 @@ def do_create(cs, args):
opts['labels'] = zun_utils.format_args(args.label)
opts['image_pull_policy'] = args.image_pull_policy
opts['image_driver'] = args.image_driver
hints = zun_utils.format_args(args.hint)
opts['hint'] = hints
if args.command:
opts['command'] = ' '.join(args.command)
if args.restart:
@@ -425,12 +415,6 @@ def do_kill(cs, args):
metavar='<command>',
nargs=argparse.REMAINDER,
help='Send command to the container')
@utils.arg('--hint',
action='append',
default=[],
metavar='<key=value>',
help='Container hint key/value pairs for scheduler to select'
' host. May be used multiple times.')
def do_run(cs, args):
"""Run a command in a new container."""
opts = {}
@@ -443,10 +427,6 @@ def do_run(cs, args):
opts['labels'] = zun_utils.format_args(args.label)
opts['image_pull_policy'] = args.image_pull_policy
opts['image_driver'] = args.image_driver
hints = zun_utils.format_args(args.hint)
opts['hint'] = hints
if args.command:
opts['command'] = ' '.join(args.command)
if args.restart: