diff --git a/setup.cfg b/setup.cfg index 4c11ddb..b50f78e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,7 +39,6 @@ openstack.ssh.v1 = ssh_usercert_create = tatuclient.v1.cli.usercert:CreateUserCertCommand ssh_usercert_list = tatuclient.v1.cli.usercert:ListUserCertCommand ssh_usercert_show = tatuclient.v1.cli.usercert:ShowUserCertCommand - usercert_cert_show = tatuclient.v1.cli.usercert:ShowUserCertCertCommand ssh_usercert_revoke = tatuclient.v1.cli.usercert:RevokeUserCertCommand ssh_host_list = tatuclient.v1.cli.host:ListHostCommand @@ -47,13 +46,10 @@ openstack.ssh.v1 = ssh_hostcert_list = tatuclient.v1.cli.hostcert:ListHostCertCommand ssh_hostcert_show = tatuclient.v1.cli.hostcert:ShowHostCertCommand - hostcert_cert_show = tatuclient.v1.cli.hostcert:ShowHostCertCertCommand ssh_ca_create = tatuclient.v1.cli.ca:CreateCACommand ssh_ca_list = tatuclient.v1.cli.ca:ListCACommand ssh_ca_show = tatuclient.v1.cli.ca:ShowCACommand - sshca_user_key_show = tatuclient.v1.cli.ca:ShowCAUserKeyCommand - sshca_host_key_show = tatuclient.v1.cli.ca:ShowCAHostKeyCommand ssh_pat_list = tatuclient.v1.cli.pat:ListPATCommand diff --git a/tatuclient/utils.py b/tatuclient/utils.py index 0aba1d5..a7df41b 100644 --- a/tatuclient/utils.py +++ b/tatuclient/utils.py @@ -69,7 +69,7 @@ def get_item_properties(item, fields, mixed_case_fields=[], formatters={}): if field in formatters: row.append(formatters[field](item)) else: - row.append(get_property(item, field, mixed_case_fields)) + row.append(get_item_property(item, field, mixed_case_fields)) return tuple(row) diff --git a/tatuclient/v1/cli/ca.py b/tatuclient/v1/cli/ca.py index 9ef14d2..f2c712f 100644 --- a/tatuclient/v1/cli/ca.py +++ b/tatuclient/v1/cli/ca.py @@ -63,22 +63,6 @@ class ShowCACommand(command.ShowOne): return _names, utils.get_item_properties(data, _columns) -class ShowCAUserKeyCommand(ShowCACommand): - """Print the CA's unformatted public key for user certificates.""" - - def take_action(self, parsed_args): - data = self._get_data(parsed_args) - self.app.stdout.write(utils.get_item_property(data, 'user_pub_key')) - - -class ShowCAHostKeyCommand(ShowCACommand): - """Print the CA's unformatted public key for user certificates.""" - - def take_action(self, parsed_args): - data = self._get_data(parsed_args) - self.app.stdout.write(utils.get_item_property(data, 'host_pub_key')) - - class CreateCACommand(command.ShowOne): """Create new CA""" diff --git a/tatuclient/v1/cli/hostcert.py b/tatuclient/v1/cli/hostcert.py index c1f6685..5d26288 100644 --- a/tatuclient/v1/cli/hostcert.py +++ b/tatuclient/v1/cli/hostcert.py @@ -24,8 +24,8 @@ from tatuclient.v1.utils import get_all LOG = logging.getLogger(__name__) -_columns = ['host_id', 'fingerprint', 'hostname', 'created_at', 'expires_at'] -_names = ['Instance ID', 'Fingerprint', 'Hostname', 'Created', 'Expires'] +_columns = ['hostname', 'host_id', 'fingerprint', 'created_at', 'expires_at'] +_names = ['Hostname', 'Instance ID', 'Fingerprint', 'Created', 'Expires'] class ListHostCertCommand(command.Lister): @@ -60,12 +60,5 @@ class ShowHostCertCommand(command.ShowOne): def take_action(self, parsed_args): data = self._get_data(parsed_args) - return _names, utils.get_item_properties(data, _columns) - - -class ShowUserCertCertCommand(ShowUserCertCommand): - """Print the HostCert's unformatted certificate data.""" - - def take_action(self, parsed_args): - data = self._get_data(parsed_args) - self.app.stdout.write(utils.get_item_property(data, 'cert')) + return (_names + ['Certificate'], + utils.get_item_properties(data, _columns + ['cert'])) diff --git a/tatuclient/v1/cli/usercert.py b/tatuclient/v1/cli/usercert.py index 94c7e2d..565ddb5 100644 --- a/tatuclient/v1/cli/usercert.py +++ b/tatuclient/v1/cli/usercert.py @@ -59,15 +59,8 @@ class ShowUserCertCommand(command.ShowOne): def take_action(self, parsed_args): data = self._get_data(parsed_args) - return _names, utils.get_item_properties(data, _columns) - - -class ShowUserCertCertCommand(ShowUserCertCommand): - """Print the UserCert's unformatted certificate data.""" - - def take_action(self, parsed_args): - data = self._get_data(parsed_args) - self.app.stdout.write(utils.get_item_property(data, 'cert')) + return (_names + ['Certificate'], + utils.get_item_properties(data, _columns + ['cert'])) class CreateUserCertCommand(command.ShowOne): @@ -85,7 +78,8 @@ class CreateUserCertCommand(command.ShowOne): data = client.usercert.create(client.session.get_user_id(), client.session.get_project_id(), parsed_args.pub_key) - return _names, utils.get_item_properties(data, _columns) + return (_names + ['Certificate'], + utils.get_item_properties(data, _columns + ['cert'])) class RevokeUserCertCommand(command.ShowOne):