<commit_before>from eclcli.common import command
from eclcli.common import utils

class CreateKeypair(command.ShowOne):
    """Create/Import keypair with/without a SSH public key"""

    def get_parser(self, prog_name):
        parser = super(CreateKeypair, self).get_parser(prog_name)
        parser.add_argument(
            "keypair",
            metavar = "<keypair>",
            help = "keypair name",
        )
        parser.add_argument(
            "--public-key",
            metavar = "<public-key>",
            help = "public key to import",
        )
        return parser

    def take_action(self, parsed_args):
        bare_client = self.app.client_manager.bare
        identity_client = self.app.client_manager.identity

        if parsed_args.public_key:
            columns = (
                'Name',
                'Public key',
            )

            data = bare_client.keypairs.create(
                parsed_args.keypair,
                parsed_args.public_key)

        else:
            columns = (
                'Name',
            )
            data = bare_client.keypairs.create(parsed_args.keypair)

        return (columns, utils.get_item_properties(data,columns))

class DeleteKeypair(command.ShowOne):
    """Delete keypair"""
<commit_msg>fix: Add missing keys in keypair create response<commit_after>from eclcli.common import command
from eclcli.common import utils

class CreateKeypair(command.ShowOne):
    """Create/Import keypair with/without a SSH public key"""

    def get_parser(self, prog_name):
        parser = super(CreateKeypair, self).get_parser(prog_name)
        parser.add_argument(
            "keypair",
            metavar = "<keypair>",
            help = "keypair name",
        )
        parser.add_argument(
            "--public-key",
            metavar = "<public-key>",
            help = "public key to import",
        )
        return parser

    def take_action(self, parsed_args):
        bare_client = self.app.client_manager.bare
        identity_client = self.app.client_manager.identity

        if parsed_args.public_key:
            columns = (
                'Name',
                'Fingerprint',
                'Public key',
            )

            data = bare_client.keypairs.create(
                parsed_args.keypair,
                parsed_args.public_key)

        else:
            columns = (
                'Name',
                'Fingerprint',
                'Public Key',
                'Private Key',
            )
            data = bare_client.keypairs.create(parsed_args.keypair)

        return (columns, utils.get_item_properties(data,columns))

class DeleteKeypair(command.ShowOne):
    """Delete keypair"""

{'fraction_non_alphanumeric': 0.09669117647058824, 'fraction_numerical': 0.0, 'mean_word_length': 1.776530612244898, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5752140', 'n_tokens_mistral': 785, 'n_tokens_neox': 735, 'n_words': 153}