On Fri, Mar 2, 2012 at 10:22 PM, Leonid Flaks <flaks@bnl.gov> wrote:
I was bitten by the bug in keep_ssh_host_keys snippet while installing Fedora-16 virtual guest system. The keys where not preserved. Did some digging and came up with this attached fix. It turned out that anaconda created temporary partition on /dev/dm-0 and it had an empty /etc/ssh directory. On a virtual guest it was listed first in the output of 'cat /proc/partitions' and original findkeys function was setting the 'keys_found' flag to yes although  nothing was copied and no other partitions were tried. Now I am setting this flag only on successful copy.
This was not an issue on a physical system as this partition was listed last and never actually got mounted.

We use very similar snippets keep_files and keep_cfengine_keys which use the same function. I have not changed those yet. If kickstart file uses all of them together, then the same function is defined more then once and I don't like it. It would make more sense to put it into separate snippet , which should be loaded before any of those. I can easily do it if anybody else likes this idea.

I made a fork on the github at github.com/lflaks/cobbler-ssh-keys for this commit and pushed it.


Hi there Leon,

This looks good to me, i will merge it into my local tree before merging into the cobbler repo.
Any further improvements to snippets are much appreciated!

Thanks!

--
Grtz,
Jörgen Maas