code: def create_gc3pie_config_snippet(cluster):
      
      auth_section = 'auth/elasticluster_%s' % cluster.name
      resource_section = 'resource/elasticluster_%s' % cluster.name
  
      cfg = RawConfigParser()
      cfg.add_section(auth_section)
  
      frontend_node = cluster.get_ssh_to_node()
      cfg.set(auth_section, 'type', 'ssh')
      cfg.set(auth_section, 'username', frontend_node.image_user)
  
      cluster_info = inspect_node(frontend_node)
      cfg.add_section(resource_section)
      cfg.set(resource_section, 'enabled', 'yes')
      cfg.set(resource_section, 'transport', 'ssh')
      cfg.set(resource_section, 'frontend', frontend_node.preferred_ip)
      if not cluster_info:
          log.error("Unable to gather enough information from the cluster. "
                    "Following informatino are only partial!")
          cluster_info = {'architecture': 'unknown',
                          'type': 'unknown',
                          'max_cores': -1,
                          'max_cores_per_job': -1,
                          'max_memory_per_core': -1,
                          'max_walltime': '672hours'}
  
      cfg.set(resource_section, 'type', cluster_info['type'])
      cfg.set(resource_section, 'architecture', cluster_info['architecture'])
      cfg.set(resource_section, 'max_cores', cluster_info.get('max_cores', 1))
      cfg.set(resource_section, 'max_cores_per_job', cluster_info.get('max_cores_per_job', 1))
      cfg.set(resource_section, 'max_memory_per_core', cluster_info.get('max_memory_per_core', '2GB'))
      cfg.set(resource_section, 'max_walltime', cluster_info.get('max_walltime', '672hours'))
  
      cfgstring = StringIO()
      cfg.write(cfgstring)
  
      return cfgstring.getvalue()
docs: Create a configuration file snippet to be used with GC3Pie.