def build_kubeconfig(server):
    'Gather the relevant data for Kubernetes configuration objects and create\n    a config object with that information.'
    layer_options = layer.options('tls-client')
    ca = layer_options.get('ca_certificate_path')
    ca_exists = (ca and os.path.isfile(ca))
    client_pass = get_password('basic_auth.csv', 'admin')
    if (ca_exists and client_pass):
        kubeconfig_path = os.path.join(os.sep, 'home', 'ubuntu', 'config')
        create_kubeconfig(kubeconfig_path, server, ca, user='admin', password=client_pass)
        cmd = ['chown', 'ubuntu:ubuntu', kubeconfig_path]
        check_call(cmd)
Gather the relevant data for Kubernetes configuration objects and create
a config object with that information.
def build_kubeconfig(server):
    'Gather the relevant data for Kubernetes configuration objects and create\n    a config object with that information.'
    layer_options = layer.options('tls-client')
    ca = layer_options.get('ca_certificate_path')
    ca_exists = (ca and os.path.isfile(ca))
    client_pass = get_password('basic_auth.csv', 'admin')
    if (ca_exists and client_pass):
        kubeconfig_path = os.path.join(os.sep, 'home', 'ubuntu', 'config')
        create_kubeconfig(kubeconfig_path, server, ca, user='admin', password=client_pass)
        cmd = ['chown', 'ubuntu:ubuntu', kubeconfig_path]
        check_call(cmd)