Merge "Remove access_secret_id from cratonclient"
This commit is contained in:
commit
3912b47732
@ -135,11 +135,6 @@ def do_host_list(cc, args):
|
|||||||
help='Status of the host. Active or inactive.')
|
help='Status of the host. Active or inactive.')
|
||||||
@cliutils.arg('--note',
|
@cliutils.arg('--note',
|
||||||
help='Note about the host.')
|
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',
|
@cliutils.arg('-l', '--labels',
|
||||||
default=[],
|
default=[],
|
||||||
help='List of labels for the host.')
|
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.')
|
help='Status of the host. Active or inactive.')
|
||||||
@cliutils.arg('--note',
|
@cliutils.arg('--note',
|
||||||
help='Note about the host.')
|
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',
|
@cliutils.arg('-l', '--labels',
|
||||||
default=[],
|
default=[],
|
||||||
help='List of labels for the host.')
|
help='List of labels for the host.')
|
||||||
|
@ -94,7 +94,6 @@ class TestDoHostList(base.TestShellCommandUsingPrintList):
|
|||||||
region_id=246,
|
region_id=246,
|
||||||
)
|
)
|
||||||
self.assertSortedPrintListFieldsEqualTo([
|
self.assertSortedPrintListFieldsEqualTo([
|
||||||
'access_secret_id',
|
|
||||||
'active',
|
'active',
|
||||||
'cell_id',
|
'cell_id',
|
||||||
'created_at',
|
'created_at',
|
||||||
@ -198,7 +197,6 @@ class TestDoHostCreate(base.TestShellCommandUsingPrintDict):
|
|||||||
kwargs.setdefault('device_type', 'host')
|
kwargs.setdefault('device_type', 'host')
|
||||||
kwargs.setdefault('active', True)
|
kwargs.setdefault('active', True)
|
||||||
kwargs.setdefault('note', None)
|
kwargs.setdefault('note', None)
|
||||||
kwargs.setdefault('access_secret_id', None)
|
|
||||||
kwargs.setdefault('labels', [])
|
kwargs.setdefault('labels', [])
|
||||||
return super(TestDoHostCreate, self).args_for(**kwargs)
|
return super(TestDoHostCreate, self).args_for(**kwargs)
|
||||||
|
|
||||||
@ -241,26 +239,6 @@ class TestDoHostCreate(base.TestShellCommandUsingPrintDict):
|
|||||||
wrap=72,
|
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):
|
def test_with_labels(self):
|
||||||
"""Verify that we pass along our labels."""
|
"""Verify that we pass along our labels."""
|
||||||
args = self.args_for(labels=['label-0', 'label-1'])
|
args = self.args_for(labels=['label-0', 'label-1'])
|
||||||
@ -309,7 +287,6 @@ class TestDoHostUpdate(base.TestShellCommandUsingPrintDict):
|
|||||||
kwargs.setdefault('cell_id', None)
|
kwargs.setdefault('cell_id', None)
|
||||||
kwargs.setdefault('active', True)
|
kwargs.setdefault('active', True)
|
||||||
kwargs.setdefault('note', None)
|
kwargs.setdefault('note', None)
|
||||||
kwargs.setdefault('access_secret_id', None)
|
|
||||||
kwargs.setdefault('labels', [])
|
kwargs.setdefault('labels', [])
|
||||||
return super(TestDoHostUpdate, self).args_for(**kwargs)
|
return super(TestDoHostUpdate, self).args_for(**kwargs)
|
||||||
|
|
||||||
@ -395,7 +372,6 @@ class TestDoHostUpdate(base.TestShellCommandUsingPrintDict):
|
|||||||
region_id=789,
|
region_id=789,
|
||||||
cell_id=101,
|
cell_id=101,
|
||||||
note='A note about a host',
|
note='A note about a host',
|
||||||
access_secret_id=1001,
|
|
||||||
labels=['label1', 'label2'],
|
labels=['label1', 'label2'],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -409,7 +385,6 @@ class TestDoHostUpdate(base.TestShellCommandUsingPrintDict):
|
|||||||
region_id=789,
|
region_id=789,
|
||||||
cell_id=101,
|
cell_id=101,
|
||||||
note='A note about a host',
|
note='A note about a host',
|
||||||
access_secret_id=1001,
|
|
||||||
labels=['label1', 'label2'],
|
labels=['label1', 'label2'],
|
||||||
)
|
)
|
||||||
self.print_mock.assert_called_once_with(
|
self.print_mock.assert_called_once_with(
|
||||||
|
@ -39,7 +39,6 @@ HOST_FIELDS = {
|
|||||||
'ip_address': 'IP Address',
|
'ip_address': 'IP Address',
|
||||||
'active': 'Active',
|
'active': 'Active',
|
||||||
'note': 'Note',
|
'note': 'Note',
|
||||||
'access_secret_id': "Access Secret ID",
|
|
||||||
'created_at': 'Created At',
|
'created_at': 'Created At',
|
||||||
'update_at': 'Updated At',
|
'update_at': 'Updated At',
|
||||||
'labels': 'Labels',
|
'labels': 'Labels',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user