diff options
author | Petr Viktorin <pviktori@redhat.com> | 2014-03-20 11:45:13 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-03-20 15:38:16 +0100 |
commit | 44b065a2778f93716670da5c1d8334f6f86a1020 (patch) | |
tree | 585461c022d20eef0174f86933ceeae7135ce5da /ipatests/test_integration/tasks.py | |
parent | 1f4869a3fa35b837b7734146a30249a294d0ad4e (diff) | |
download | freeipa-44b065a2778f93716670da5c1d8334f6f86a1020.tar.gz freeipa-44b065a2778f93716670da5c1d8334f6f86a1020.tar.xz freeipa-44b065a2778f93716670da5c1d8334f6f86a1020.zip |
test_integration.tasks: Do not fail cleanup if backup directory does not exist
If the test backup directory was never created (for example if
there was an early failure, or install was never run),
we don't want the test to fail.
Do not restore if the backup dir is not there.
Reviewed-By: Martin Kosek <mkosek@redhat.com>
Diffstat (limited to 'ipatests/test_integration/tasks.py')
-rw-r--r-- | ipatests/test_integration/tasks.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index b785f2819..0d916ca46 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -133,7 +133,8 @@ def restore_files(host): "/sbin/restorecon -v" % (backupname, sed_remove_backupdir)) # Prepare command for actual restoring of the backed up files - copyfiles_command = 'cp -arvf %s/* /' % ipautil.shell_quote(backupname) + copyfiles_command = 'if [ -d %(dir)s/ ]; then cp -arvf %(dir)s/* /; fi' % { + 'dir': ipautil.shell_quote(backupname)} # Run both commands in one session. For more information, see: # https://fedorahosted.org/freeipa/ticket/4133 |