Loosen the check for RHEL-6 update numbers.

We have never had a case where a RHEL minor update has
broken the installer.  Thus, we can afford to accept any
version number within a major RHEL version.  This will make
it so that we don't have to release a new version of Oz
for every minor RHEL/CentOS update

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Cleanup the screenshot directory in cleanup_cache

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Quote apt-add-repository arguments to allow for non-ppa inputs

This allows for `deb http://example.com foo main` type of input. apt-add-repository requires it to be quoted. A PPA input can also be quoted without problems.
The commit allows people to add the `deb` bit to the TDL without having to add in the extra quotes around it in there.

Note: This would break things for people that have already used quotes in their TDL - That's why the strip() call is there

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
In Ubuntu 12.10 apt-add-repository got moved to software-properties-common

See https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1021418 for information

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Fix up a typo from the apt-add-repository commit

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Consolidate a lot of redundant backup/restore code.

This code is mostly used for doing manipulation on the
image during customization pre- and post-.  There was a
lot of duplication there, so this patch consolidates that
into a couple of functions, and then replaces the redundancy
with those functions.  This gets rid of a lot of error-prone
code.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Make sure to delete ssh keys after customization.

Otherwise, cached images could end up with the same keys.
Problem pointed out by Geert Jansen.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>