code: def update_relations(context, namespace_separator=':'):
      
      # Add any relation data prefixed with the relation type.
      relation_type = charmhelpers.core.hookenv.relation_type()
      relations = []
      context['current_relation'] = {}
      if relation_type is not None:
          relation_data = charmhelpers.core.hookenv.relation_get()
          context['current_relation'] = relation_data
          # Deprecated: the following use of relation data as keys
          # directly in the context will be removed.
          relation_data = dict(
              ("{relation_type}{namespace_separator}{key}".format(
                  relation_type=relation_type,
                  key=key,
                  namespace_separator=namespace_separator), val)
              for key, val in relation_data.items())
          relation_data = dict_keys_without_hyphens(relation_data)
          context.update(relation_data)
          relations = charmhelpers.core.hookenv.relations_of_type(relation_type)
          relations = [dict_keys_without_hyphens(rel) for rel in relations]
  
      context['relations_full'] = charmhelpers.core.hookenv.relations()
  
      # the hookenv.relations() data structure is effectively unusable in
      # templates and other contexts when trying to access relation data other
      # than the current relation. So provide a more useful structure that works
      # with any hook.
      local_unit = charmhelpers.core.hookenv.local_unit()
      relations = {}
      for rname, rids in context['relations_full'].items():
          relations[rname] = []
          for rid, rdata in rids.items():
              data = rdata.copy()
              if local_unit in rdata:
                  data.pop(local_unit)
              for unit_name, rel_data in data.items():
                  new_data = {'__relid__': rid, '__unit__': unit_name}
                  new_data.update(rel_data)
                  relations[rname].append(new_data)
      context['relations'] = relations
docs: Update the context with the relation data.