projectatomic / commissaire-mvp

A lightweight REST interface for upgrading, restarting, and bootstrapping new hosts into an existing Container Management cluster.
http://commissaire.readthedocs.org/en/latest/
GNU General Public License v3.0
15 stars 9 forks source link

Created a commissaire.util.ssh package. #172

Closed ashcrow closed 8 years ago

ashcrow commented 8 years ago

This is the first module in the new util package. It adds a common class for handling temporary ssh keys. It also updates code which previously manually handled keys.

rh-atomic-bot commented 8 years ago

:umbrella: The latest upstream changes (presumably efbbad8) made this pull request unmergeable. Please resolve the merge conflicts.

ashcrow commented 8 years ago

(2) [multi-host-mgr] Merge temporary ssh key code

ashcrow commented 8 years ago

I think the CI failure is leftover from the Travis issues.

mbarnes commented 8 years ago

Nice looking cleanup.

It occurred to me TemporarySSHKey could follow a context manager pattern by adding an __enter__ method and converting remove to __exit__. Mainly just syntactic sugar, but it would be neat to do with TemporarySSHKey(host, logger) as key and know it'll get removed. Just a thought, certainly not a blocker.

ashcrow commented 8 years ago

I'll add context manager support just for the heck of it :-)

ashcrow commented 8 years ago

:arrow_up:

mbarnes commented 8 years ago

Ah, I was expecting to see with blocks in the "jobs" code but this works too. :+1:

ashcrow commented 8 years ago

@mbarnes admittedly I am being lazy and not redoing the areas to use the context manager. But later we can utilize it.

mbarnes commented 8 years ago

I hear ya. Auto-squashed and human-merged.