# Path: magnumclient/common/cliutils.py
# DEPRECATION_BASE = ('%sThe --%s parameter is deprecated and '
#                     'will be removed in a future release. Use the '
#                     '<%s> positional parameter %s.')
# NAME_DEPRECATION_HELP = DEPRECATION_BASE % ('', 'name', 'name', 'instead')
# NAME_DEPRECATION_WARNING = DEPRECATION_BASE % (
#     'WARNING: ', 'name', 'name', 'to avoid seeing this message')
# CLUSTER_DEPRECATION_HELP = DEPRECATION_BASE % ('', 'cluster', 'cluster',
#                                                'instead')
# CLUSTER_DEPRECATION_WARNING = DEPRECATION_BASE % (
#     'WARNING: ', 'cluster', 'cluster', 'to avoid seeing this message')
# MAGNUM_CLIENT_DEPRECATION_WARNING = (
#     'WARNING: The magnum client is deprecated and will be removed in a future '
#     'release.\nUse the OpenStack client to avoid seeing this message.')
# def deprecation_message(preamble, new_name):
#     def __init__(self, missing):
#     def __init__(self, param, dupes):
# def validate_args(fn, *args, **kwargs):
#     def isbound(method):
# def validate_name_args(positional_name, optional_name):
# def validate_cluster_args(positional_cluster, optional_cluster):
# def deprecated(message):
#     def wrapper(func, *args, **kwargs):
# def deprecation_map(dep_map):
#     def _decorator(func):
# def arg(*args, **kwargs):
#     def _decorator(func):
# def env(*args, **kwargs):
# def add_arg(func, *args, **kwargs):
# def unauthenticated(func):
# def isunauthenticated(func):
# def print_list(objs, fields, formatters=None, sortby_index=0,
#                mixed_case_fields=None, field_labels=None):
# def keys_and_vals_to_strs(dictionary):
#     def to_str(k_or_v):
# def print_dict(dct, dict_property="Property", wrap=0):
# def get_password(max_password_prompts=3):
# def service_type(stype):
#     def inner(f):
# def get_service_type(f):
# def pretty_choice_list(lst):
# def exit(msg=''):
# def _format_field_name(attr):
# def make_field_formatter(attr, filters=None):
#     def get_field(obj):
# def _get_list_table_columns_and_formatters(fields, objs, exclude_fields=(),
#                                            filters=None):
# class MissingArgs(Exception):
# class DuplicateArgs(Exception):
# 
# 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/v1/client.py
# DEFAULT_SERVICE_TYPE = 'container-infra'
# LEGACY_DEFAULT_SERVICE_TYPE = 'container'
# def _load_session(cloud=None, insecure=False, timeout=None, **kwargs):
# def _load_service_type(session,
#                        service_type=None, service_name=None,
#                        interface=None, region_name=None):
# def _load_session_client(session=None, endpoint_override=None, username=None,
#                          project_id=None, project_name=None,
#                          auth_url=None, password=None, auth_type=None,
#                          insecure=None, user_domain_id=None,
#                          user_domain_name=None, project_domain_id=None,
#                          project_domain_name=None, auth_token=None,
#                          timeout=None, service_type=None, service_name=None,
#                          interface=None, region_name=None, api_version=None,
#                          **kwargs):
#     def __init__(self, username=None, api_key=None, project_id=None,
#                  project_name=None, auth_url=None, magnum_url=None,
#                  endpoint_type=None, endpoint_override=None,
#                  service_type=DEFAULT_SERVICE_TYPE,
#                  region_name=None, input_auth_token=None,
#                  session=None, password=None, auth_type='password',
#                  interface=None, service_name=None, insecure=False,
#                  user_domain_id=None, user_domain_name=None,
#                  project_domain_id=None, project_domain_name=None,
#                  auth_token=None, timeout=600, api_version=None,
#                  **kwargs):
# class Client(object):
# 
# Path: magnumclient/v1/shell.py
# COMMAND_MODULES = [
#     baymodels_shell,
#     bays_shell,
#     certificates_shell,
#     clusters_shell,
#     cluster_templates_shell,
#     mservices_shell,
#     stats_shell,
#     quotas_shell,
# ]
# 
# Path: magnumclient/version.py



import argparse
import logging
import os
import sys
    import keyring
            import gnomekeyring
from oslo_utils import encodeutils
from oslo_utils import importutils
from oslo_utils import strutils
from magnumclient.common import cliutils
from magnumclient import exceptions as exc
from magnumclient.i18n import _
from magnumclient.v1 import client as client_v1
from magnumclient.v1 import shell as shell_v1
from magnumclient import version
            subcommand_parser.print_help()
            return 0

        args = subcommand_parser.parse_args(argv)

        # Short-circuit and deal with help right away.
        # NOTE(jamespage): args.func is not guaranteed with python >= 3.4
        if not hasattr(args, 'func') or args.func == self.do_help:
            self.do_help(args)
            return 0
        elif args.func == self.do_bash_completion:
            self.do_bash_completion(args)
            return 0

        if not args.service_type:
            args.service_type = DEFAULT_SERVICE_TYPE

        if args.bypass_url:
            args.os_endpoint_override = args.bypass_url

        args.os_project_id = (args.os_project_id or args.os_tenant_id)
        args.os_project_name = (args.os_project_name or args.os_tenant_name)

        self._ensure_auth_info(args)

        try:
            client = {
                '1': client_v1,
            }[api_major_version]
        except KeyError:

# Path: magnumclient/common/cliutils.py
# DEPRECATION_BASE = ('%sThe --%s parameter is deprecated and '
#                     'will be removed in a future release. Use the '
#                     '<%s> positional parameter %s.')
# NAME_DEPRECATION_HELP = DEPRECATION_BASE % ('', 'name', 'name', 'instead')
# NAME_DEPRECATION_WARNING = DEPRECATION_BASE % (
#     'WARNING: ', 'name', 'name', 'to avoid seeing this message')
# CLUSTER_DEPRECATION_HELP = DEPRECATION_BASE % ('', 'cluster', 'cluster',
#                                                'instead')
# CLUSTER_DEPRECATION_WARNING = DEPRECATION_BASE % (
#     'WARNING: ', 'cluster', 'cluster', 'to avoid seeing this message')
# MAGNUM_CLIENT_DEPRECATION_WARNING = (
#     'WARNING: The magnum client is deprecated and will be removed in a future '
#     'release.\nUse the OpenStack client to avoid seeing this message.')
# def deprecation_message(preamble, new_name):
#     def __init__(self, missing):
#     def __init__(self, param, dupes):
# def validate_args(fn, *args, **kwargs):
#     def isbound(method):
# def validate_name_args(positional_name, optional_name):
# def validate_cluster_args(positional_cluster, optional_cluster):
# def deprecated(message):
#     def wrapper(func, *args, **kwargs):
# def deprecation_map(dep_map):
#     def _decorator(func):
# def arg(*args, **kwargs):
#     def _decorator(func):
# def env(*args, **kwargs):
# def add_arg(func, *args, **kwargs):
# def unauthenticated(func):
# def isunauthenticated(func):
# def print_list(objs, fields, formatters=None, sortby_index=0,
#                mixed_case_fields=None, field_labels=None):
# def keys_and_vals_to_strs(dictionary):
#     def to_str(k_or_v):
# def print_dict(dct, dict_property="Property", wrap=0):
# def get_password(max_password_prompts=3):
# def service_type(stype):
#     def inner(f):
# def get_service_type(f):
# def pretty_choice_list(lst):
# def exit(msg=''):
# def _format_field_name(attr):
# def make_field_formatter(attr, filters=None):
#     def get_field(obj):
# def _get_list_table_columns_and_formatters(fields, objs, exclude_fields=(),
#                                            filters=None):
# class MissingArgs(Exception):
# class DuplicateArgs(Exception):
# 
# 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/v1/client.py
# DEFAULT_SERVICE_TYPE = 'container-infra'
# LEGACY_DEFAULT_SERVICE_TYPE = 'container'
# def _load_session(cloud=None, insecure=False, timeout=None, **kwargs):
# def _load_service_type(session,
#                        service_type=None, service_name=None,
#                        interface=None, region_name=None):
# def _load_session_client(session=None, endpoint_override=None, username=None,
#                          project_id=None, project_name=None,
#                          auth_url=None, password=None, auth_type=None,
#                          insecure=None, user_domain_id=None,
#                          user_domain_name=None, project_domain_id=None,
#                          project_domain_name=None, auth_token=None,
#                          timeout=None, service_type=None, service_name=None,
#                          interface=None, region_name=None, api_version=None,
#                          **kwargs):
#     def __init__(self, username=None, api_key=None, project_id=None,
#                  project_name=None, auth_url=None, magnum_url=None,
#                  endpoint_type=None, endpoint_override=None,
#                  service_type=DEFAULT_SERVICE_TYPE,
#                  region_name=None, input_auth_token=None,
#                  session=None, password=None, auth_type='password',
#                  interface=None, service_name=None, insecure=False,
#                  user_domain_id=None, user_domain_name=None,
#                  project_domain_id=None, project_domain_name=None,
#                  auth_token=None, timeout=600, api_version=None,
#                  **kwargs):
# class Client(object):
# 
# Path: magnumclient/v1/shell.py
# COMMAND_MODULES = [
#     baymodels_shell,
#     bays_shell,
#     certificates_shell,
#     clusters_shell,
#     cluster_templates_shell,
#     mservices_shell,
#     stats_shell,
#     quotas_shell,
# ]
# 
# Path: magnumclient/version.py



# Path: magnumclient/shell.py
import argparse
import logging
import os
import sys
    import keyring
            import gnomekeyring
from oslo_utils import encodeutils
from oslo_utils import importutils
from oslo_utils import strutils
from magnumclient.common import cliutils
from magnumclient import exceptions as exc
from magnumclient.i18n import _
from magnumclient.v1 import client as client_v1
from magnumclient.v1 import shell as shell_v1
from magnumclient import version

            subcommand_parser.print_help()
            return 0

        args = subcommand_parser.parse_args(argv)

        # Short-circuit and deal with help right away.
        # NOTE(jamespage): args.func is not guaranteed with python >= 3.4
        if not hasattr(args, 'func') or args.func == self.do_help:
            self.do_help(args)
            return 0
        elif args.func == self.do_bash_completion:
            self.do_bash_completion(args)
            return 0

        if not args.service_type:
            args.service_type = DEFAULT_SERVICE_TYPE

        if args.bypass_url:
            args.os_endpoint_override = args.bypass_url

        args.os_project_id = (args.os_project_id or args.os_tenant_id)
        args.os_project_name = (args.os_project_name or args.os_tenant_name)

        self._ensure_auth_info(args)

        try:
            client = {
                '1': client_v1,
            }[api_major_version]
        except KeyError:

            client = client_v1