The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Change-Id: Ia1bbe6bd173435674075bee595001a7e8aa0d4ec
Previously the logic around hitting the end of the file without having
found the insertion point didn't account for the fact that you might
be in roughly the right area, and would not need to duplicate the meta
section or section headers.
This takes that into account during the else phase. It will help with
the neutron functional jobs that merge a lot of snippets together.
Change-Id: Ifaa1176e9fdfbc4fdb43192ed2f85e7306823848
Previously if we tried to added content to a local.conf file without a
local section, we actually inserted that content in the wrong place at
the end of the file. This fixes that, with unit tests.
Change-Id: Ib886d78ce5f3718def784db59ba9abf41bdb0e7b
setlc_raw can be used to set several lines at once. The test checks that
it works as expected. See I565f5420743fbd95e9d744010c488953c54dd8a4
for some context of why that is useful.
Change-Id: I21bd78fa6169002a70fa9074d56d985bfc0b833f
the localrc is really just executable shell, which means there are
tons of edgecases where you can't treat it the same as simple
assignment a=b.
Instead of trying to be smart about things and reduce duplication in
the localrc files, just do the naive thing and stack up all the shell
declarations in order. When evaluated in shell they will end up
stacking up as expected.
Change-Id: I231d130b24b02cdd79618f85472cee21905884e0
It's important when setting localrc name=value that there are no
spaces around the = sign, otherwise it doesn't work. Remember to treat
localrc special from the iniset portions.
python3 argparse adds native subparsers, which makes this much easier
to build without external dependencies (which improves load and run
time). 20ms for most operations means we can do 50 / sec. This will be
a slow down from the awk approach, but for larger gains in
readability.