docs: def parse(config_path):
      """ Parse the configuration file
  
      :type config_path: str
      :param config_path: Path to the configuration file
      """
      config_path = os.path.expanduser(config_path)
  
      # Read the configuration file
      config_file = ConfigParser.RawConfigParser()
      config_file.SECTCRE = re.compile(r"\[ *(?P<header>.*) *\]")
      config_file.optionxform = lambda option: option
      config_file.read(config_path)
  
      #
      # Handle [global]
      #
      if 'global' in config_file.sections():
          global_config = __parse_options(
              config_file,
              'global',
              [
                  {
                      'key': 'aws_access_key_id',
                      'option': 'aws-access-key-id',
                      'required': False,
                      'type': 'str'
                  },
                  {
                      'key': 'aws_secret_access_key',
                      'option': 'aws-secret-access-key-id',
                      'required': False,
                      'type': 'str'
                  },
                  {
                      'key': 'region',
                      'option': 'region',
                      'required': False,
                      'type': 'str'
                  },
                  {
                      'key': 'check_interval',
                      'option': 'check-interval',
                      'required': False,
                      'type': 'int'
                  },
                  {
                      'key': 'circuit_breaker_url',
                      'option': 'circuit-breaker-url',
                      'required': False,
                      'type': 'str'
                  },
                  {
                      'key': 'circuit_breaker_timeout',
                      'option': 'circuit-breaker-timeout',
                      'required': False,
                      'type': 'float'
                  },
              ])
  
      #
      # Handle [logging]
      #
      if 'logging' in config_file.sections():
          logging_config = __parse_options(
              config_file,
              'logging',
              [
                  {
                      'key': 'log_level',
                      'option': 'log-level',
                      'required': False,
                      'type': 'str'
                  },
                  {
                      'key': 'log_file',
                      'option': 'log-file',
                      'required': False,
                      'type': 'str'
                  },
                  {
                      'key': 'log_config_file',
                      'option': 'log-config-file',
                      'required': False,
                      'type': 'str'
                  }
              ])
  
      if 'default_options' in config_file.sections():
          # nothing is required in defaults, so we set required to False
          default_config_options = deepcopy(TABLE_CONFIG_OPTIONS)
          for item in default_config_options:
              item['required'] = False
          default_options = __parse_options(
              config_file, 'default_options', default_config_options)
          # if we've got a default set required to be false for table parsing
          for item in TABLE_CONFIG_OPTIONS:
              if item['key'] in default_options:
                  item['required'] = False
      else:
          default_options = {}
  
      #
      # Handle [table: ]
      #
      table_config = {'tables': ordereddict()}
  
      # Find the first table definition
      found_table = False
      for current_section in config_file.sections():
          if current_section.rsplit(':', 1)[0] != 'table':
              continue
  
          found_table = True
          current_table_name = current_section.rsplit(':', 1)[1].strip()
          table_config['tables'][current_table_name] = \
              dict(default_options.items() + __parse_options(
                  config_file, current_section, TABLE_CONFIG_OPTIONS).items())
  
      if not found_table:
          print('Could not find a [table: <table_name>] section in {0}'.format(
              config_path))
          sys.exit(1)
  
      # Find gsi definitions - this allows gsi's to be defined before the table
      # definitions we don't worry about parsing everything twice here
      for current_section in config_file.sections():
          try:
              header1, gsi_key, header2, table_key = current_section.split(' ')
          except ValueError:
              continue
  
          if header1 != 'gsi:':
              continue
  
          if table_key not in table_config['tables']:
              print('No table configuration matching {0} found.'.format(
                  table_key))
              sys.exit(1)
  
          if 'gsis' not in table_config['tables'][table_key]:
              table_config['tables'][table_key]['gsis'] = {}
  
          table_config['tables'][table_key]['gsis'][gsi_key] = \
              ordereddict(default_options.items() + __parse_options(
                  config_file, current_section, TABLE_CONFIG_OPTIONS).items())
  
      return ordereddict(
          global_config.items() +
          logging_config.items() +
          table_config.items())