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
This commit is contained in:
parent
4c1fac38bf
commit
fe8fe5989a
cratonclient
@ -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='<access_secret>',
|
||||
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='<access_secret>',
|
||||
type=int,
|
||||
help='ID of the access secret of the host.')
|
||||
@cliutils.arg('-l', '--labels',
|
||||
default=[],
|
||||
help='List of labels for the host.')
|
||||
|
@ -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(
|
||||
|
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user