# Path: invtool/main.py
# def do_dispatch(args, IN=sys.stdin):
#     inv_parser = argparse.ArgumentParser(prog='invtool')
#     format_group = inv_parser.add_mutually_exclusive_group()
#     format_group.add_argument(
#         '--json', default=False, dest='p_json',  action='store_true',
#         help="Format the output as JSON"
#     )
#     format_group.add_argument(
#         '--silent', default=False, dest='p_silent', action='store_true',
#         help="Silence all stdout and stderr"
#     )
#     format_group.add_argument(
#         '--debug', default=False, dest='DEBUG', action='store_true',
#         help="Print stuff"
#     )
#     format_group.add_argument(
#         '--pk-only', default=False, dest='p_pk_only', action='store_true',
#         help="If an object was just update/created print the primary key"
#         "of that object otherwise print nothing. No new line is printed."
#     )
#     base_parser = inv_parser.add_subparsers(dest='dtype')
# 
#     # Build parsers. Parses should register arguments.
#     for d in registrar.dispatches:
#         d.build_parser(base_parser)
# 
#     nas = inv_parser.parse_args(args)
#     nas.IN = IN  # Where invtool reads its input from
#     if nas.p_pk_only:
#         nas.p_json = True
#     return nas, dispatch(nas)
# 
# Path: invtool/lib/config.py
# REMOTE = "http{0}://{1}{2}".format(
#     's' if dev != 'True' else '',
#     host,
#     '' if port == '80' else ':' + port
# )
# 
# def auth():
#     global authcache
#     if authcache is False:
#         authcache = _realauth()
# 
#     return authcache


import simplejson as json
import shlex
import io
import requests
from invtool.main import do_dispatch
from invtool.lib.config import REMOTE, auth
#!/usr/bin/env python



class BAError(Exception):
    def __init__(self, error=None):
        self.error = error
        return super(BAError, self).__init__()


def ba_gather_vlan_pools(site, vlan_name, vlan_number, ip_type='4'):
    """
    This function should phone home to inventory and pull down a list of ip
    ranges.
    """
    tmp_url = "/en-US/bulk_action/gather_vlan_pools/"

# Path: invtool/main.py
# def do_dispatch(args, IN=sys.stdin):
#     inv_parser = argparse.ArgumentParser(prog='invtool')
#     format_group = inv_parser.add_mutually_exclusive_group()
#     format_group.add_argument(
#         '--json', default=False, dest='p_json',  action='store_true',
#         help="Format the output as JSON"
#     )
#     format_group.add_argument(
#         '--silent', default=False, dest='p_silent', action='store_true',
#         help="Silence all stdout and stderr"
#     )
#     format_group.add_argument(
#         '--debug', default=False, dest='DEBUG', action='store_true',
#         help="Print stuff"
#     )
#     format_group.add_argument(
#         '--pk-only', default=False, dest='p_pk_only', action='store_true',
#         help="If an object was just update/created print the primary key"
#         "of that object otherwise print nothing. No new line is printed."
#     )
#     base_parser = inv_parser.add_subparsers(dest='dtype')
# 
#     # Build parsers. Parses should register arguments.
#     for d in registrar.dispatches:
#         d.build_parser(base_parser)
# 
#     nas = inv_parser.parse_args(args)
#     nas.IN = IN  # Where invtool reads its input from
#     if nas.p_pk_only:
#         nas.p_json = True
#     return nas, dispatch(nas)
# 
# Path: invtool/lib/config.py
# REMOTE = "http{0}://{1}{2}".format(
#     's' if dev != 'True' else '',
#     host,
#     '' if port == '80' else ':' + port
# )
# 
# def auth():
#     global authcache
#     if authcache is False:
#         authcache = _realauth()
# 
#     return authcache


# Path: invtool/lib/ba.py
import simplejson as json
import shlex
import io
import requests
from invtool.main import do_dispatch
from invtool.lib.config import REMOTE, auth

#!/usr/bin/env python



class BAError(Exception):
    def __init__(self, error=None):
        self.error = error
        return super(BAError, self).__init__()


def ba_gather_vlan_pools(site, vlan_name, vlan_number, ip_type='4'):
    """
    This function should phone home to inventory and pull down a list of ip
    ranges.
    """
    tmp_url = "/en-US/bulk_action/gather_vlan_pools/"

    url = "{0}{1}".format(REMOTE, tmp_url)