Hi All,

Please review this patch.

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From 9148f39e340f9441be2b9e613485374b0f769559 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 3 Jun 2016 14:54:14 +0530
Subject: [PATCH] Added force option to rmdir

In order to remove directory with contents,
rmdir requires --ignore-fail-on-non-empty option

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 pytest_multihost/transport.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pytest_multihost/transport.py b/pytest_multihost/transport.py
index 8a36f02b56bfb8ba55069f76ebcd11e40ee5dc27..9622fc77698183884e8fe5624c63627426788d16 100644
--- a/pytest_multihost/transport.py
+++ b/pytest_multihost/transport.py
@@ -374,9 +374,12 @@ class OpenSSHTransport(Transport):
         else:
             raise IOError('File %r could not be read' % filename)
 
-    def rmdir(self, path):
+    def rmdir(self, path, force=False):
         self.log.info('RMDIR %s', path)
-        cmd = self._run(['rmdir', path])
+        cmdlist = ['rmdir', path]
+        if force:
+            cmdlist.append('--ignore-fail-on-non-empty')
+        cmd = self._run(cmdlist)
         cmd.wait()
 
     def remove_file(self, filepath):
-- 
2.4.11

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to