Make missing encryption key error message more helpful (#1074441)

Signed-off-by: mulhern <amulhern@redhat.com>
(cherry picked from commit e43817c71e690be96d8cb042c006c3accdf4b803)

Resolves: rhbz#1074441
Add a contextmanager to create and remove sparse tempfiles.

with sparsetmpfile("mytest", Size("100 MiB")) as path:
  do_stuff(fn=path)

It creates a sparse temporary file with the specified size and yields its
full path on __enter__, then unlinks the file on __exit__.

(cherry picked from commit d394eacb0472a6173fb486712caf18c80fd4c5fd)

Related: rhbz#1075561
Add a DiskFile class for testing partitioning code as a non-root user.

There seems to be some special treatment from parted (first free sector
is reported as 32) but the main purpose is to test partitioning code
without committing the changes to disk. It may be perfectly viable to
commit to these devices, but I haven't tried it yet. My intention is to
write unit tests for things like partition allocation -- which require
parted Device and Disk instances -- without requiring root access.

(cherry picked from commit 19a53f8bbda0c8f473b19585329ec4b68553561a)

Related: rhbz#1075561
Add a couple of tests for blivet.partitioning.DiskChunk.

(cherry picked from commit 62d8632a67cab1145361d5967e84e517eb5427a0)

Related: rhbz#1075561
Add some tests for blivet.partitioning.addPartition.

(cherry picked from commit 0690d0201e61dd68d39068cbf09ded6ae399423b)

Related: rhbz#1075561
Make _filterDevices() return a generator consistently

Previously, it returned a list when incomplete was True and a
generator when it was False.

Signed-off-by: mulhern <amulhern@redhat.com>
(cherry picked from commit 7be0a17fe4d611e6fd4a6d794dfe9d2ee7e37dc1)

Related: rhbz#1122081
Related: rhbz#1075561
Make prefering leaves the default in getDeviceByPath

Preferring leaves was the default until commit
822d92457e36768b9daa6a3ec689e494e9ba07df which deliberately but
mistakenly reversed the preference.

Signed-off-by: mulhern <amulhern@redhat.com>
(cherry picked from commit cfc77d64ddf28a8c978120b74cfe08c7bc31add1)

Related: rhbz#1122081
Related: rhbz#1075561
Don't pass md array UUID as member format UUID.

(cherry picked from commit bc9ae63e6378cee712a879b59836f8c119205e7d)

Related: rhbz#1070095
Related: rhbz#1075561
Update transifex config for rhel7-branch.

Related: rhbz#1075561
Remove dependency on python-six.

Related: rhbz#1075561