def complete_node(arg):
<EOL>try:<EOL><INDENT>cmd = cfg.get('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>except configparser.NoOptionError:<EOL><INDENT>return [ '<STR_LIT>', ]<EOL><DEDENT>cmd = re.sub('<STR_LIT>', pipes.quote(arg), cmd)<EOL>args = shlex.split(cmd)<EOL>p = subprocess.Popen(args, stdout=subprocess.PIPE)<EOL>res, err = p.communicate()<EOL>nodes = res.split('<STR_LIT:\n>')<EOL>return nodes<EOL>
Complete node hostname

        This function is currently a bit special as it looks in the config file
        for a command to use to complete a node hostname from an external
        system.

        It is configured by setting the config attribute "complete_node_cmd" to
        a shell command. The string "%search_string%" in the command will be
        replaced by the current search string.