def generate_cmd(cmd='ceph',
                 sub_cmd=None,
                 args=None,
                 user_key=None,
                 cluster='ceph',
                 user='client.admin',
                 container_image=None,
                 interactive=False):
    '''
    Generate 'ceph' command line to execute
    '''

    if user_key is None:
        user_key = '/etc/ceph/{}.{}.keyring'.format(cluster, user)

    cmd = pre_generate_cmd(cmd, container_image=container_image, interactive=interactive)  # noqa: E501

    base_cmd = [
        '-n',
        user,
        '-k',
        user_key,
        '--cluster',
        cluster
    ]

    if sub_cmd is not None:
        base_cmd.extend(sub_cmd)

    cmd.extend(base_cmd) if args is None else cmd.extend(base_cmd + args)

    return cmd

    Generate 'ceph' command line to execute
    
module_utils/ca_common.py