Merge branch 'master' of https://github.com/pinodeca/python-tatuclient
This commit is contained in:
commit
28ecc7505b
@ -39,7 +39,6 @@ openstack.ssh.v1 =
|
|||||||
ssh_usercert_create = tatuclient.v1.cli.usercert:CreateUserCertCommand
|
ssh_usercert_create = tatuclient.v1.cli.usercert:CreateUserCertCommand
|
||||||
ssh_usercert_list = tatuclient.v1.cli.usercert:ListUserCertCommand
|
ssh_usercert_list = tatuclient.v1.cli.usercert:ListUserCertCommand
|
||||||
ssh_usercert_show = tatuclient.v1.cli.usercert:ShowUserCertCommand
|
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_usercert_revoke = tatuclient.v1.cli.usercert:RevokeUserCertCommand
|
||||||
|
|
||||||
ssh_host_list = tatuclient.v1.cli.host:ListHostCommand
|
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_list = tatuclient.v1.cli.hostcert:ListHostCertCommand
|
||||||
ssh_hostcert_show = tatuclient.v1.cli.hostcert:ShowHostCertCommand
|
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_create = tatuclient.v1.cli.ca:CreateCACommand
|
||||||
ssh_ca_list = tatuclient.v1.cli.ca:ListCACommand
|
ssh_ca_list = tatuclient.v1.cli.ca:ListCACommand
|
||||||
ssh_ca_show = tatuclient.v1.cli.ca:ShowCACommand
|
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
|
ssh_pat_list = tatuclient.v1.cli.pat:ListPATCommand
|
||||||
|
|
||||||
|
@ -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', 'fingerprint', 'hostname', 'created_at', 'expires_at']
|
_columns = ['hostname', 'host_id', 'fingerprint', 'created_at', 'expires_at']
|
||||||
_names = ['Instance ID', 'Fingerprint', 'Hostname', 'Created', 'Expires']
|
_names = ['Hostname', 'Instance ID', 'Fingerprint', 'Created', 'Expires']
|
||||||
|
|
||||||
|
|
||||||
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