# Path: smc/api/exceptions.py
# class ConfigLoadError(SMCException):
#     """
#     Thrown when there was a problem reading credential information from
#     file. Typically caused by missing settings.
#     """


import os
import io
import json
    import configparser
    import ConfigParser as configparser  # @UnusedImport
from smc.api.exceptions import ConfigLoadError
        from urllib.parse import urlparse
        from urlparse import urlparse
    the environment.
    
    Fields are::
    
        SMC_ADDRESS=http://1.1.1.1:8082
        SMC_API_KEY=123abc
        SMC_CLIENT_CERT=path/to/cert
        SMC_TIMEOUT = 30 (seconds)
        SMC_API_VERSION = 6.1 (optional - uses latest by default)
        SMC_DOMAIN = name of domain, Shared is default
        SMC_EXTRA_ARGS = string in dict format of extra args needed
    
    SMC_CLIENT CERT is only checked IF the SMC_URL is an HTTPS url.
    
    Example of forcing retry on service unavailable::
    
        os.environ['SMC_EXTRA_ARGS'] = '{"retry_on_busy": "True"}'
    
    """
    try:
    except ImportError:
    
    smc_address = os.environ.get('SMC_ADDRESS', '')
    smc_apikey = os.environ.get('SMC_API_KEY', '')
    smc_timeout = os.environ.get('SMC_TIMEOUT', None)
    api_version = os.environ.get('SMC_API_VERSION', None)
    domain = os.environ.get('SMC_DOMAIN', None)
    smc_extra_args = os.environ.get('SMC_EXTRA_ARGS', '')
    
    if not smc_apikey or not smc_address:

# Path: smc/api/exceptions.py
# class ConfigLoadError(SMCException):
#     """
#     Thrown when there was a problem reading credential information from
#     file. Typically caused by missing settings.
#     """


# Path: smc/api/configloader.py
import os
import io
import json
    import configparser
    import ConfigParser as configparser  # @UnusedImport
from smc.api.exceptions import ConfigLoadError
        from urllib.parse import urlparse
        from urlparse import urlparse

    the environment.
    
    Fields are::
    
        SMC_ADDRESS=http://1.1.1.1:8082
        SMC_API_KEY=123abc
        SMC_CLIENT_CERT=path/to/cert
        SMC_TIMEOUT = 30 (seconds)
        SMC_API_VERSION = 6.1 (optional - uses latest by default)
        SMC_DOMAIN = name of domain, Shared is default
        SMC_EXTRA_ARGS = string in dict format of extra args needed
    
    SMC_CLIENT CERT is only checked IF the SMC_URL is an HTTPS url.
    
    Example of forcing retry on service unavailable::
    
        os.environ['SMC_EXTRA_ARGS'] = '{"retry_on_busy": "True"}'
    
    """
    try:
    except ImportError:
    
    smc_address = os.environ.get('SMC_ADDRESS', '')
    smc_apikey = os.environ.get('SMC_API_KEY', '')
    smc_timeout = os.environ.get('SMC_TIMEOUT', None)
    api_version = os.environ.get('SMC_API_VERSION', None)
    domain = os.environ.get('SMC_DOMAIN', None)
    smc_extra_args = os.environ.get('SMC_EXTRA_ARGS', '')
    
    if not smc_apikey or not smc_address:

        raise ConfigLoadError(