From fe8fe5989a178a05e2f90f4cff4c79ca79a91d28 Mon Sep 17 00:00:00 2001 From: Sulochan Acharya Date: Wed, 25 Jan 2017 15:00:46 +0000 Subject: [PATCH] Remove access_secret_id from cratonclient We dont use and wont be using access_secret_id the way it is right now. This patch therefore removes this since it does not work at all. Closes Bug: 1659104 Change-Id: I3ac685cb3958742a348007b40cedf6be5293ca7d --- cratonclient/shell/v1/hosts_shell.py | 10 -------- .../tests/unit/shell/v1/test_hosts_shell.py | 25 ------------------- cratonclient/v1/hosts.py | 1 - 3 files changed, 36 deletions(-) diff --git a/cratonclient/shell/v1/hosts_shell.py b/cratonclient/shell/v1/hosts_shell.py index 00726e8..d9b9bc6 100644 --- a/cratonclient/shell/v1/hosts_shell.py +++ b/cratonclient/shell/v1/hosts_shell.py @@ -135,11 +135,6 @@ def do_host_list(cc, args): help='Status of the host. Active or inactive.') @cliutils.arg('--note', help='Note about the host.') -@cliutils.arg('--access_secret', - type=int, - dest='access_secret_id', - metavar='', - help='ID of the access secret of the host.') @cliutils.arg('-l', '--labels', default=[], help='List of labels for the host.') @@ -177,11 +172,6 @@ def do_host_create(cc, args): help='Status of the host. Active or inactive.') @cliutils.arg('--note', help='Note about the host.') -@cliutils.arg('--access_secret', - dest='access_secret_id', - metavar='', - type=int, - help='ID of the access secret of the host.') @cliutils.arg('-l', '--labels', default=[], help='List of labels for the host.') diff --git a/cratonclient/tests/unit/shell/v1/test_hosts_shell.py b/cratonclient/tests/unit/shell/v1/test_hosts_shell.py index 8fe85f0..ad52bd0 100644 --- a/cratonclient/tests/unit/shell/v1/test_hosts_shell.py +++ b/cratonclient/tests/unit/shell/v1/test_hosts_shell.py @@ -94,7 +94,6 @@ class TestDoHostList(base.TestShellCommandUsingPrintList): region_id=246, ) self.assertSortedPrintListFieldsEqualTo([ - 'access_secret_id', 'active', 'cell_id', 'created_at', @@ -198,7 +197,6 @@ class TestDoHostCreate(base.TestShellCommandUsingPrintDict): kwargs.setdefault('device_type', 'host') kwargs.setdefault('active', True) kwargs.setdefault('note', None) - kwargs.setdefault('access_secret_id', None) kwargs.setdefault('labels', []) return super(TestDoHostCreate, self).args_for(**kwargs) @@ -241,26 +239,6 @@ class TestDoHostCreate(base.TestShellCommandUsingPrintDict): wrap=72, ) - def test_with_access_secret(self): - """Verify that we pass along an access secret.""" - args = self.args_for(access_secret_id=789) - - hosts_shell.do_host_create(self.craton_client, args) - - self.craton_client.hosts.create.assert_called_once_with( - name='test-hostname', - ip_address='10.0.1.10', - cell_id=246, - device_type='host', - active=True, - region_id=123, - access_secret_id=789, - ) - self.print_dict.assert_called_once_with( - {f: mock.ANY for f in hosts.HOST_FIELDS}, - wrap=72, - ) - def test_with_labels(self): """Verify that we pass along our labels.""" args = self.args_for(labels=['label-0', 'label-1']) @@ -309,7 +287,6 @@ class TestDoHostUpdate(base.TestShellCommandUsingPrintDict): kwargs.setdefault('cell_id', None) kwargs.setdefault('active', True) kwargs.setdefault('note', None) - kwargs.setdefault('access_secret_id', None) kwargs.setdefault('labels', []) return super(TestDoHostUpdate, self).args_for(**kwargs) @@ -395,7 +372,6 @@ class TestDoHostUpdate(base.TestShellCommandUsingPrintDict): region_id=789, cell_id=101, note='A note about a host', - access_secret_id=1001, labels=['label1', 'label2'], ) @@ -409,7 +385,6 @@ class TestDoHostUpdate(base.TestShellCommandUsingPrintDict): region_id=789, cell_id=101, note='A note about a host', - access_secret_id=1001, labels=['label1', 'label2'], ) self.print_mock.assert_called_once_with( diff --git a/cratonclient/v1/hosts.py b/cratonclient/v1/hosts.py index e201df7..aac22ee 100644 --- a/cratonclient/v1/hosts.py +++ b/cratonclient/v1/hosts.py @@ -39,7 +39,6 @@ HOST_FIELDS = { 'ip_address': 'IP Address', 'active': 'Active', 'note': 'Note', - 'access_secret_id': "Access Secret ID", 'created_at': 'Created At', 'update_at': 'Updated At', 'labels': 'Labels',