Parameter format change for ca-show and ca-sign
The parameter format for ca-show and ca-sign is not consistent with other cmds. Closes-Bug: #1567812 Change-Id: If75d3d00983e0db185b7edb993d8b6761716ff1d
This commit is contained in:
parent
71967890b6
commit
3291208222
@ -27,7 +27,7 @@ class ShellTest(shell_test_base.TestCommandLineArgument):
|
|||||||
mockbay.status = "CREATE_COMPLETE"
|
mockbay.status = "CREATE_COMPLETE"
|
||||||
mock_bay_get.return_value = mockbay
|
mock_bay_get.return_value = mockbay
|
||||||
self._test_arg_success('ca-show '
|
self._test_arg_success('ca-show '
|
||||||
'--bay xxx')
|
'xxx')
|
||||||
self.assertTrue(mock_cert_get.called)
|
self.assertTrue(mock_cert_get.called)
|
||||||
|
|
||||||
@mock.patch('os.path.isfile')
|
@mock.patch('os.path.isfile')
|
||||||
@ -44,8 +44,8 @@ class ShellTest(shell_test_base.TestCommandLineArgument):
|
|||||||
file_mock = mock.mock_open(read_data=fake_csr)
|
file_mock = mock.mock_open(read_data=fake_csr)
|
||||||
with mock.patch.object(certificates_shell, 'open', file_mock):
|
with mock.patch.object(certificates_shell, 'open', file_mock):
|
||||||
self._test_arg_success('ca-sign '
|
self._test_arg_success('ca-sign '
|
||||||
'--csr path/csr.pem '
|
'xxx '
|
||||||
'--bay xxx')
|
'path/csr.pem')
|
||||||
self.assertTrue(mock_cert_create.called)
|
self.assertTrue(mock_cert_create.called)
|
||||||
|
|
||||||
@mock.patch('os.path.isfile')
|
@mock.patch('os.path.isfile')
|
||||||
@ -62,8 +62,8 @@ class ShellTest(shell_test_base.TestCommandLineArgument):
|
|||||||
file_mock = mock.mock_open(read_data=fake_csr)
|
file_mock = mock.mock_open(read_data=fake_csr)
|
||||||
with mock.patch.object(certificates_shell, 'open', file_mock):
|
with mock.patch.object(certificates_shell, 'open', file_mock):
|
||||||
self._test_arg_success('ca-sign '
|
self._test_arg_success('ca-sign '
|
||||||
'--csr path/csr.pem '
|
'xxx '
|
||||||
'--bay xxx')
|
'path/csr.pem')
|
||||||
mock_isfile.assert_called_once_with('path/csr.pem')
|
mock_isfile.assert_called_once_with('path/csr.pem')
|
||||||
self.assertFalse(file_mock.called)
|
self.assertFalse(file_mock.called)
|
||||||
self.assertFalse(mock_cert_create.called)
|
self.assertFalse(mock_cert_create.called)
|
||||||
|
@ -21,8 +21,7 @@ def _show_cert(certificate):
|
|||||||
print(certificate.pem)
|
print(certificate.pem)
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--bay',
|
@utils.arg('bay',
|
||||||
required=True,
|
|
||||||
metavar='<bay>',
|
metavar='<bay>',
|
||||||
help='ID or name of the bay.')
|
help='ID or name of the bay.')
|
||||||
def do_ca_show(cs, args):
|
def do_ca_show(cs, args):
|
||||||
@ -36,13 +35,12 @@ def do_ca_show(cs, args):
|
|||||||
_show_cert(cert)
|
_show_cert(cert)
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--csr',
|
@utils.arg('bay',
|
||||||
metavar='<csr>',
|
|
||||||
help='File path of the csr file to send to Magnum to get signed.')
|
|
||||||
@utils.arg('--bay',
|
|
||||||
required=True,
|
|
||||||
metavar='<bay>',
|
metavar='<bay>',
|
||||||
help='ID or name of the bay.')
|
help='ID or name of the bay.')
|
||||||
|
@utils.arg('csr',
|
||||||
|
metavar='<csr>',
|
||||||
|
help='File path of the csr file to send to Magnum to get signed.')
|
||||||
def do_ca_sign(cs, args):
|
def do_ca_sign(cs, args):
|
||||||
"""Generate the CA certificate for a bay."""
|
"""Generate the CA certificate for a bay."""
|
||||||
bay = cs.bays.get(args.bay)
|
bay = cs.bays.get(args.bay)
|
||||||
|
Loading…
Reference in New Issue
Block a user