# Path: magnumclient/common/utils.py
# def common_filters(marker=None, limit=None, sort_key=None, sort_dir=None):
# def split_and_deserialize(string):
# def args_array_to_patch(op, attributes):
# def handle_labels(labels):
# def format_labels(lbls, parse_comma=True):
# def print_list_field(field):
# def handle_json_from_file(json_arg):
# def config_cluster(cluster, cluster_template, cfg_dir, force=False,
#                    certs=None, use_keystone=False):
# def _config_cluster_kubernetes(cluster, cluster_template, cfg_dir,
#                                force=False, certs=None, use_keystone=False):
# def _config_cluster_swarm(cluster, cluster_template, cfg_dir,
#                           force=False, certs=None):
# def generate_csr_and_key():
# 
# Path: magnumclient/exceptions.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):
# 
# Path: magnumclient/i18n.py



import os
from magnumclient.common import utils as magnum_utils
from magnumclient import exceptions
from magnumclient.i18n import _
from osc_lib.command import command
from osc_lib import utils
    def take_action(self, parsed_args):
        """Configure native client to access cluster.

        You can source the output of this command to get the native client of
        the corresponding COE configured to access the cluster.

        """
        if parsed_args.use_keystone:
            parsed_args.use_certificate = False
        if not parsed_args.use_certificate:
            parsed_args.use_keystone = True

        self.log.debug("take_action(%s)", parsed_args)

        mag_client = self.app.client_manager.container_infra

        parsed_args.dir = os.path.abspath(parsed_args.dir)
        cluster = mag_client.clusters.get(parsed_args.cluster)
        if cluster.api_address is None:
            self.log.warning("WARNING: The cluster's api_address is"
                             " not known yet.")

        cluster_template = mag_client.cluster_templates.get(
            cluster.cluster_template_id)
        opts = {
            'cluster_uuid': cluster.uuid,
        }

        tls = None
        if not cluster_template.tls_disabled:

# Path: magnumclient/common/utils.py
# def common_filters(marker=None, limit=None, sort_key=None, sort_dir=None):
# def split_and_deserialize(string):
# def args_array_to_patch(op, attributes):
# def handle_labels(labels):
# def format_labels(lbls, parse_comma=True):
# def print_list_field(field):
# def handle_json_from_file(json_arg):
# def config_cluster(cluster, cluster_template, cfg_dir, force=False,
#                    certs=None, use_keystone=False):
# def _config_cluster_kubernetes(cluster, cluster_template, cfg_dir,
#                                force=False, certs=None, use_keystone=False):
# def _config_cluster_swarm(cluster, cluster_template, cfg_dir,
#                           force=False, certs=None):
# def generate_csr_and_key():
# 
# Path: magnumclient/exceptions.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):
# 
# Path: magnumclient/i18n.py



# Path: magnumclient/osc/v1/clusters.py
import os
from magnumclient.common import utils as magnum_utils
from magnumclient import exceptions
from magnumclient.i18n import _
from osc_lib.command import command
from osc_lib import utils

    def take_action(self, parsed_args):
        """Configure native client to access cluster.

        You can source the output of this command to get the native client of
        the corresponding COE configured to access the cluster.

        """
        if parsed_args.use_keystone:
            parsed_args.use_certificate = False
        if not parsed_args.use_certificate:
            parsed_args.use_keystone = True

        self.log.debug("take_action(%s)", parsed_args)

        mag_client = self.app.client_manager.container_infra

        parsed_args.dir = os.path.abspath(parsed_args.dir)
        cluster = mag_client.clusters.get(parsed_args.cluster)
        if cluster.api_address is None:
            self.log.warning("WARNING: The cluster's api_address is"
                             " not known yet.")

        cluster_template = mag_client.cluster_templates.get(
            cluster.cluster_template_id)
        opts = {
            'cluster_uuid': cluster.uuid,
        }

        tls = None
        if not cluster_template.tls_disabled:

            tls = magnum_utils.generate_csr_and_key()