diff options
| author | Zuul <zuul@review.openstack.org> | 2018-05-28 03:38:58 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2018-05-28 03:38:58 +0000 |
| commit | 4856c7fc6e0f67b31f1a33aba7da92477ce0f6c1 (patch) | |
| tree | fbf586ca8ded48ee445f5ab7f501d25f1aa63b81 | |
| parent | 7283dedb131e356290ceb384b30877f95d61aa5a (diff) | |
| parent | eafde59a3ed028d460e1b449cf50e16f032c94fa (diff) | |
| download | python-cinderclient-4856c7fc6e0f67b31f1a33aba7da92477ce0f6c1.tar.gz | |
Merge "Add the parameter service-id for service cleanup command"
| -rw-r--r-- | cinderclient/tests/unit/v3/test_shell.py | 6 | ||||
| -rw-r--r-- | cinderclient/v3/shell.py | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py index d7e97f1..651fd50 100644 --- a/cinderclient/tests/unit/v3/test_shell.py +++ b/cinderclient/tests/unit/v3/test_shell.py @@ -1275,13 +1275,15 @@ class ShellTest(utils.TestCase): self.run_command('--os-volume-api-version 3.24 ' 'work-cleanup --cluster clustername --host hostname ' '--binary binaryname --is-up false --disabled true ' - '--resource-id uuid --resource-type Volume') + '--resource-id uuid --resource-type Volume ' + '--service-id 1') expected = {'cluster_name': 'clustername', 'host': 'hostname', 'binary': 'binaryname', 'is_up': 'false', 'disabled': 'true', 'resource_id': 'uuid', - 'resource_type': 'Volume'} + 'resource_type': 'Volume', + 'service_id': 1} self.assert_called('POST', '/workers/cleanup', body=expected) diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py index 4149f61..fc74399 100644 --- a/cinderclient/v3/shell.py +++ b/cinderclient/v3/shell.py @@ -1101,12 +1101,19 @@ def do_cluster_disable(cs, args): @utils.arg('--resource-type', metavar='<Volume|Snapshot>', default=None, choices=('Volume', 'Snapshot'), help='Type of resource to cleanup.') +@utils.arg('--service-id', + metavar='<service-id>', + type=int, + default=None, + help='The service id field from the DB, not the uuid of the' + ' service. Default=None.') def do_work_cleanup(cs, args): """Request cleanup of services with optional filtering.""" filters = dict(cluster_name=args.cluster, host=args.host, binary=args.binary, is_up=args.is_up, disabled=args.disabled, resource_id=args.resource_id, - resource_type=args.resource_type) + resource_type=args.resource_type, + service_id=args.service_id) filters = {k: v for k, v in filters.items() if v is not None} |
