From fc695639687c2030e7703343ce88ab7ff082f2ac Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 29 May 2017 21:37:25 +0000 Subject: [PATCH] Revert "Add scheduler hint for zunclient" This reverts commit 7f6efb562b3187459a4340a96da4e1956fc36c47. Change-Id: Iea91bcd2a0b58314507ebde181f96967a5397717 Closes-Bug: #1694332 --- zunclient/osc/v1/containers.py | 20 -------------------- zunclient/v1/containers.py | 3 +-- zunclient/v1/containers_shell.py | 20 -------------------- 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/zunclient/osc/v1/containers.py b/zunclient/osc/v1/containers.py index aaeaf753..129ae64f 100644 --- a/zunclient/osc/v1/containers.py +++ b/zunclient/osc/v1/containers.py @@ -112,13 +112,6 @@ class CreateContainer(command.ShowOne): metavar='', 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='', 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) diff --git a/zunclient/v1/containers.py b/zunclient/v1/containers.py index f54e8961..512d77b0 100644 --- a/zunclient/v1/containers.py +++ b/zunclient/v1/containers.py @@ -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): diff --git a/zunclient/v1/containers_shell.py b/zunclient/v1/containers_shell.py index 5285f837..30412f1b 100644 --- a/zunclient/v1/containers_shell.py +++ b/zunclient/v1/containers_shell.py @@ -85,12 +85,6 @@ def _show_container(container): metavar='', nargs=argparse.REMAINDER, help='Send command to the container') -@utils.arg('--hint', - action='append', - default=[], - metavar='', - 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='', nargs=argparse.REMAINDER, help='Send command to the container') -@utils.arg('--hint', - action='append', - default=[], - metavar='', - 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: