task/ceph_manager:  Fix NoneType config issue

kill_mon is getting a config set to None, which blows
up now due to the check for powercycle.  Initialize
the config to an empty dict if we don't get anything
on init.  This is the error showing up in teuthology:

2013-02-04T15:04:16.595 ERROR:teuthology.run_tasks:Manager failed: <contextlib.GeneratorContextManager object at 0x1fcafd0>
Traceback (most recent call last):
  File "/var/lib/teuthworker/teuthology-master/teuthology/run_tasks.py", line 45, in run_tasks
    suppress = manager.__exit__(*exc_info)
  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/var/lib/teuthworker/teuthology-master/teuthology/task/mon_thrash.py", line 142, in task
    thrash_proc.do_join()
  File "/var/lib/teuthworker/teuthology-master/teuthology/task/mon_thrash.py", line 69, in do_join
    self.thread.get()
  File "/var/lib/teuthworker/teuthology-master/virtualenv/local/lib/python2.7/site-packages/gevent/greenlet.py", line 308, in get
    raise self._exception
AttributeError: 'NoneType' object has no attribute 'get'

Signed-off-by: Sam Lang <sam.lang@inktank.com>
misc:  Close connections on reboot

When nodes are rebooted, the connections remain open
even after calling reconnect and setting up new ssh
sessions to the rebooted nodes.  This causes ECONNRESET
errors to show up in the teuthology output.

Close the existing connections before trying to reconnect.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
rbd: set env before running sudo

Signed-off-by: Sage Weil <sage@inktank.com>
rbd: fix rbd image unmount

The testdir param was missing.  Avoid this class of errors by unmounting
exactly what we mounted.
nuke: make tmpfs check only umount tmpfs

This would catch things like /tmp/cephtest/mnt.client.0, which are
used by cfuse, rbd, and kclient.
nuke: don't try unmount if we're rebooting everything anyway

This can cause issues when unmount hangs. Our automatic runs reboot
everything unconditionally, so this caused a bunch of unecessary hangs
when an fs was accidentally rendered un-unmountable.
rgw: fix testdir format on f

Format the path, not filehandle
radosbench: fix missing format value

tdir is substituted in at the end.  There is probably a better way to do
this.
ceph_manager: take int or string to osd_admin_socket

This fixes a failure on dump_stuck.
osd_recovery: add missing testdir arg
rgw: parse testdir into apache.conf

Also fix up the template to use {{field}} for stuff we don't want to parse.
There is probably a better way...

Signed-off-by: Sage Weil <sage@inktank.com>
Merge to include --machine-type and changes to --summary

Added the ability to support multiple types of machines with
--machine-type added to teuthology-lock when used with --lock-many
or --machine-type with teuthology --lock (automated tests). It
defaults to 'plana' and the 'vps' type is currently unused but
should be in the future.

Also updated teutholoy-lock --summary to be machine type aware
and sort things in a nice output.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>