Show certificates only on single records, not lists.
This commit is contained in:
parent
ea431b2011
commit
f29cf34fb8
@ -39,18 +39,14 @@ openstack.ssh.v1 =
|
|||||||
usercert_create = tatuclient.v1.cli.usercert:CreateUserCertCommand
|
usercert_create = tatuclient.v1.cli.usercert:CreateUserCertCommand
|
||||||
usercert_list = tatuclient.v1.cli.usercert:ListUserCertCommand
|
usercert_list = tatuclient.v1.cli.usercert:ListUserCertCommand
|
||||||
usercert_show = tatuclient.v1.cli.usercert:ShowUserCertCommand
|
usercert_show = tatuclient.v1.cli.usercert:ShowUserCertCommand
|
||||||
usercert_cert_show = tatuclient.v1.cli.usercert:ShowUserCertCertCommand
|
|
||||||
usercert_revoke = tatuclient.v1.cli.usercert:RevokeUserCertCommand
|
usercert_revoke = tatuclient.v1.cli.usercert:RevokeUserCertCommand
|
||||||
|
|
||||||
hostcert_list = tatuclient.v1.cli.hostcert:ListHostCertCommand
|
hostcert_list = tatuclient.v1.cli.hostcert:ListHostCertCommand
|
||||||
hostcert_show = tatuclient.v1.cli.hostcert:ShowHostCertCommand
|
hostcert_show = tatuclient.v1.cli.hostcert:ShowHostCertCommand
|
||||||
hostcert_cert_show = tatuclient.v1.cli.hostcert:ShowHostCertCertCommand
|
|
||||||
|
|
||||||
sshca_create = tatuclient.v1.cli.ca:CreateCACommand
|
sshca_create = tatuclient.v1.cli.ca:CreateCACommand
|
||||||
sshca_list = tatuclient.v1.cli.ca:ListCACommand
|
sshca_list = tatuclient.v1.cli.ca:ListCACommand
|
||||||
sshca_show = tatuclient.v1.cli.ca:ShowCACommand
|
sshca_show = tatuclient.v1.cli.ca:ShowCACommand
|
||||||
sshca_user_key_show = tatuclient.v1.cli.ca:ShowCAUserKeyCommand
|
|
||||||
sshca_host_key_show = tatuclient.v1.cli.ca:ShowCAHostKeyCommand
|
|
||||||
|
|
||||||
[build_sphinx]
|
[build_sphinx]
|
||||||
builders = html,man
|
builders = html,man
|
||||||
|
@ -69,7 +69,7 @@ def get_item_properties(item, fields, mixed_case_fields=[], formatters={}):
|
|||||||
if field in formatters:
|
if field in formatters:
|
||||||
row.append(formatters[field](item))
|
row.append(formatters[field](item))
|
||||||
else:
|
else:
|
||||||
row.append(get_property(item, field, mixed_case_fields))
|
row.append(get_item_property(item, field, mixed_case_fields))
|
||||||
return tuple(row)
|
return tuple(row)
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,22 +63,6 @@ class ShowCACommand(command.ShowOne):
|
|||||||
return _names, utils.get_item_properties(data, _columns)
|
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):
|
class CreateCACommand(command.ShowOne):
|
||||||
"""Create new CA"""
|
"""Create new CA"""
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ from tatuclient.v1.utils import get_all
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
_columns = ['host_id', 'srv_url', 'pat_bastions', 'fingerprint']
|
_columns = ['host_id', 'hostname', 'srv_url', 'pat_bastions', 'fingerprint']
|
||||||
_names = ['Instance ID', 'SRV URL', 'PAT Bastions', 'Fingerprint']
|
_names = ['Instance ID', 'Hostname', 'SRV URL', 'PAT Bastions', 'Fingerprint']
|
||||||
|
|
||||||
|
|
||||||
class ListHostCertCommand(command.Lister):
|
class ListHostCertCommand(command.Lister):
|
||||||
@ -60,12 +60,5 @@ class ShowHostCertCommand(command.ShowOne):
|
|||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
data = self._get_data(parsed_args)
|
data = self._get_data(parsed_args)
|
||||||
return _names, utils.get_item_properties(data, _columns)
|
return (_names + ['Certificate'],
|
||||||
|
utils.get_item_properties(data, _columns + ['cert']))
|
||||||
|
|
||||||
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'))
|
|
||||||
|
@ -59,15 +59,8 @@ class ShowUserCertCommand(command.ShowOne):
|
|||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
data = self._get_data(parsed_args)
|
data = self._get_data(parsed_args)
|
||||||
return _names, utils.get_item_properties(data, _columns)
|
return (_names + ['Certificate'],
|
||||||
|
utils.get_item_properties(data, _columns + ['cert']))
|
||||||
|
|
||||||
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'))
|
|
||||||
|
|
||||||
|
|
||||||
class CreateUserCertCommand(command.ShowOne):
|
class CreateUserCertCommand(command.ShowOne):
|
||||||
@ -85,7 +78,8 @@ class CreateUserCertCommand(command.ShowOne):
|
|||||||
data = client.usercert.create(client.session.get_user_id(),
|
data = client.usercert.create(client.session.get_user_id(),
|
||||||
client.session.get_project_id(),
|
client.session.get_project_id(),
|
||||||
parsed_args.pub_key)
|
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):
|
class RevokeUserCertCommand(command.ShowOne):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user