parameters: (self, identifier)
docstring: Returns the default value for the given identifier as
             specified by the module specification, or None if there is
             no default or the identifier could not be found.
             See get_value() for a general way to find a configuration
             value
docstring_summary: Returns the default value for the given identifier as
             specified by the module specification, or None if there is
             no default or the identifier could not be found.
             See get_value() for a general way to find a configuration
             value
docstring_tokens: Returns the default value for the given identifier as specified by the module specification or None if there is no default or the identifier could not be found . See get_value () for a general way to find a configuration value
function: def get_default_value(self, identifier):
          """Returns the default value for the given identifier as
             specified by the module specification, or None if there is
             no default or the identifier could not be found.
             See get_value() for a general way to find a configuration
             value
          """
          try:
              if identifier[0] == '/':
                  identifier = identifier[1:]
              module, sep, id = identifier.partition("/")
              # if there is a 'higher-level' list index specified, we need
              # to check if that list specification has a default that
              # overrides the more specific default in the final spec item
              # (ie. list_default = [1, 2, 3], list_item_spec=int, default=0)
              # def default list[1] should return 2, not 0
              id_parts = bundy.cc.data.split_identifier(id)
              id_prefix = ""
              while len(id_parts) > 0:
                  id_part = id_parts.pop(0)
                  item_id, list_indices = bundy.cc.data.split_identifier_list_indices(id_part)
                  id_list = module + "/" + id_prefix + "/" + item_id
                  id_prefix += "/" + id_part
                  part_spec = find_spec_part(self._specifications[module].get_config_spec(), id_prefix)
                  if part_spec['item_type'] == 'named_set':
                      # For named sets, the identifier is partly defined
                      # by which values are actually present, and not
                      # purely by the specification.
                      # So if there is a part of the identifier left,
                      # we need to look up the value, then see if that
                      # contains the next part of the identifier we got
                      if len(id_parts) == 0:
                          if 'item_default' in part_spec:
                              return part_spec['item_default']
                          else:
                              return None
                      id_part = id_parts.pop(0)
                      item_id, list_indices =\
                          bundy.cc.data.split_identifier_list_indices(id_part)
  
                      named_set_value, type = self.get_value(id_list)
                      if item_id in named_set_value.keys():
                          result = named_set_value[item_id]
                          # If the item is a list and we have indices in the
                          # identifier part, continue with the item pointed to
                          # by those indices
                          if list_indices is not None:
                              while len(list_indices) > 0:
                                  result = result[list_indices.pop(0)]
  
                          if len(id_parts) > 0:
                              # we are looking for the *default* value.
                              # so if not present in here, we need to
                              # lookup the one from the spec
                              rest_of_id = "/".join(id_parts)
                              result = bundy.cc.data.find_no_exc(result, rest_of_id)
                              if result is None:
                                  spec_part = self.find_spec_part(identifier)
                                  if 'item_default' in spec_part:
                                      return spec_part['item_default']
                              return result
                          else:
                              return result
                      else:
                          return None
                  elif list_indices is not None:
                      # there's actually two kinds of default here for
                      # lists; they can have a default value (like an
                      # empty list), but their elements can  also have
                      # default values.
                      # So if the list item *itself* is a default,
                      # we need to get the value out of that. If not, we
                      # need to find the default for the specific element.
                      list_value, type = self.get_value(id_list)
                      list_spec = find_spec_part(self._specifications[module].get_config_spec(), id_prefix)
                      if type == self.DEFAULT:
                          if 'item_default' in list_spec:
                              list_value = list_spec['item_default']
                              for i in list_indices:
                                  if i < len(list_value):
                                      list_value = list_value[i]
                                  else:
                                      # out of range, return None
                                      return None
  
                              if len(id_parts) > 0:
                                  rest_of_id = "/".join(id_parts)
                                  return bundy.cc.data.find(list_value, rest_of_id)
                              else:
                                  return list_value
                      else:
                          # we do have a non-default list, see if our indices
                          # exist
                          for i in list_indices:
                              if i < len(list_value):
                                  list_value = list_value[i]
                              else:
                                  # out of range, return None
                                  return None
  
              spec = find_spec_part(self._specifications[module].get_config_spec(), id)
              if 'item_default' in spec:
                  # one special case, named_set
                  if spec['item_type'] == 'named_set':
                      return spec['item_default']
                  else:
                      return spec['item_default']
              else:
                  return None
  
          except bundy.cc.data.DataNotFoundError as dnfe:
              return None
function_tokens: def get_default_value ( self , identifier ) : try : if identifier [ 0 ] == '/' : identifier = identifier [ 1 : ] module , sep , id = identifier . partition ( "/" ) # if there is a 'higher-level' list index specified, we need # to check if that list specification has a default that # overrides the more specific default in the final spec item # (ie. list_default = [1, 2, 3], list_item_spec=int, default=0) # def default list[1] should return 2, not 0 id_parts = bundy . cc . data . split_identifier ( id ) id_prefix = "" while len ( id_parts ) > 0 : id_part = id_parts . pop ( 0 ) item_id , list_indices = bundy . cc . data . split_identifier_list_indices ( id_part ) id_list = module + "/" + id_prefix + "/" + item_id id_prefix += "/" + id_part part_spec = find_spec_part ( self . _specifications [ module ] . get_config_spec ( ) , id_prefix ) if part_spec [ 'item_type' ] == 'named_set' : # For named sets, the identifier is partly defined # by which values are actually present, and not # purely by the specification. # So if there is a part of the identifier left, # we need to look up the value, then see if that # contains the next part of the identifier we got if len ( id_parts ) == 0 : if 'item_default' in part_spec : return part_spec [ 'item_default' ] else : return None id_part = id_parts . pop ( 0 ) item_id , list_indices = bundy . cc . data . split_identifier_list_indices ( id_part ) named_set_value , type = self . get_value ( id_list ) if item_id in named_set_value . keys ( ) : result = named_set_value [ item_id ] # If the item is a list and we have indices in the # identifier part, continue with the item pointed to # by those indices if list_indices is not None : while len ( list_indices ) > 0 : result = result [ list_indices . pop ( 0 ) ] if len ( id_parts ) > 0 : # we are looking for the *default* value. # so if not present in here, we need to # lookup the one from the spec rest_of_id = "/" . join ( id_parts ) result = bundy . cc . data . find_no_exc ( result , rest_of_id ) if result is None : spec_part = self . find_spec_part ( identifier ) if 'item_default' in spec_part : return spec_part [ 'item_default' ] return result else : return result else : return None elif list_indices is not None : # there's actually two kinds of default here for # lists; they can have a default value (like an # empty list), but their elements can  also have # default values. # So if the list item *itself* is a default, # we need to get the value out of that. If not, we # need to find the default for the specific element. list_value , type = self . get_value ( id_list ) list_spec = find_spec_part ( self . _specifications [ module ] . get_config_spec ( ) , id_prefix ) if type == self . DEFAULT : if 'item_default' in list_spec : list_value = list_spec [ 'item_default' ] for i in list_indices : if i < len ( list_value ) : list_value = list_value [ i ] else : # out of range, return None return None if len ( id_parts ) > 0 : rest_of_id = "/" . join ( id_parts ) return bundy . cc . data . find ( list_value , rest_of_id ) else : return list_value else : # we do have a non-default list, see if our indices # exist for i in list_indices : if i < len ( list_value ) : list_value = list_value [ i ] else : # out of range, return None return None spec = find_spec_part ( self . _specifications [ module ] . get_config_spec ( ) , id ) if 'item_default' in spec : # one special case, named_set if spec [ 'item_type' ] == 'named_set' : return spec [ 'item_default' ] else : return spec [ 'item_default' ] else : return None except bundy . cc . data . DataNotFoundError as dnfe : return None