Use a simpler and more efficient way to trigger apt-file
installation.

Signed-off-by: Lucas Meneghel Rodrigues <l...@redhat.com>
---
 client/shared/software_manager.py |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/client/shared/software_manager.py 
b/client/shared/software_manager.py
index 2ad9e33..ba40ae7 100755
--- a/client/shared/software_manager.py
+++ b/client/shared/software_manager.py
@@ -721,9 +721,12 @@ class AptBackend(DpkgBackend):
 
         @param file: File path.
         """
-        if not self.check_installed('apt-file'):
+        try:
+            command = os_dep.command('apt-file')
+        except ValueError:
             self.install('apt-file')
-        command = os_dep.command('apt-file')
+            command = os_dep.command('apt-file')
+
         cache_update_cmd = command + ' update'
         try:
             utils.system(cache_update_cmd, ignore_status=True)
-- 
1.7.10.4

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to