܍~c 8ddlmZddlmZGddZdS))StringIO) chop_commentc8eZdZdZdZdZdZdZdZdZ dS) HostsConfc"||_d|_dSN)_text _contents)selftexts A/usr/lib/python3/dist-packages/cloudinit/distros/parsers/hosts.py__init__zHostsConf.__init__s cV|j!||j|_dSdSr)r _parser )r s r parsezHostsConf.parses+ > !![[44DNNN " !rc|g}|jD]H\}}|dkr=|\}}t|r)|d|kr||ddI|S)Noptionr)rr lenappend)r ipoptions line_type componentspieces_tails r get_entryzHostsConf.get_entrysx '+~ / / #Y H$$",v;;/6!9??NN6!"":...rc>|g}|jD]w\}}|dkr|||f#|\}}t|r |d|krDt|r$||t |fx||_dS)Nrr)rr rrlist)r r n_entriesrrrrs r del_entrieszHostsConf.del_entries"s  '+~ D D #Y H$$  )Z!8999",v;;D6!9??[[D$$ij1A1A%BCCC"rc||jd||gt|zdffdS)Nr)rr rr )r rcanonical_hostnamealiasess r add_entryzHostsConf.add_entry1sQ   /04==@"E F     rcg}|D]}t|s|d|gf? @ @ @ @rc|t}|jD]\}}|dkr|d|dz*|dkr|d|dzO|dkr@|\}}d|D}d|}|||d|S) Nr)z%s rr+rc,g|]}t|S)str).0ps r z%HostsConf.__str__..Ns111Q#a&&111r  )rrr writejoingetvalue)r r/rrrr3s r __str__zHostsConf.__str__Ds ::'+~ : : #Y G##vA78888m++vA78888h&&!+11&1116**664448999  """rN) __name__ __module__ __qualname__rrrr"r'rr@r6rr rrs}555 # # #      # # # # #rrN)iorcloudinit.distros.parsersrrr6rr rFsg222222 B#B#B#B#B#B#B#B#B#B#r