Check if dir exists before calling listdir

Changes along the way to how we clean up and detach after
copying an image to a volume exposed a problem in the cleanup
of the brick/initiator routines.

The clean up in the initiator detach was doing a blind listdir
of /dev/disk/by-path, however due to detach and cleanup being
called upon completion of the image download to the volume if
there are no other devices mapped in this directory the directory
is removed.

The result was that even though the create and copy of the image
was succesful, the HostDriver code called os.lisdir on a directory
that doesn't exist any longer and raises an unhandled exception that
cause the taskflow mechanism to mark the volume as failed.

Change-Id: I488755c1a49a77f42efbb58a7a4eb6f4f084df07
Closes-bug: #1243980
(cherry picked from commit 1766a5acc5c948288b4cd81c62d0c1507c55f727)
Allow spaces in quoted SSH command arguments

The check_ssh_injection() method was rejecting arguments with spaces
even when they were quoted, this was causing problems with some volume
driver commands such as commands for a storage pool with spaces in the
name.

Note that this backport also fixes a typo that has been fixed separately
in master with commit eb0f2e4dd538a79184efbb23d7e404147dfe877b .

Closes-Bug: #1244415
Change-Id: Ie4b809e1b39fdb752cf634e6d3c0a3924d8ac52b
(cherry picked from commit 2737c76cb2fb436f117a4f635aebca7a01691d88)
Don't zero out thin provisioned LV's on delete

Thin provisioned LV's don't need secure delete to protect
from data leakage.  Also, zeroing these out kinda defeats
the purpose of using thing provisioning.

This patch add a check for the lvm type and if it's thin simply
returns from the lvm.clear_volume() method.

Change-Id: Ie6764209018152565295291efc6fbba553698ae6
Closes-Bug: #1240299
(cherry picked from commit de4392314f9b0def8fab65679ec5668aec98fbee)
Merge "Allow spaces in quoted SSH command arguments" into stable/havana
Merge "Check if dir exists before calling listdir" into stable/havana
Merge remote-tracking branch 'upstream/stable/havana' into stable/havana