Re: RPMs Module - Verification Method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I create a method to be added in the rpms module, I am sending the modified rpms.py file as an attachment.

----------------------
   def verify(self, flatten=True):
       """
Returns information of the verification of all installed packages. """
       import subprocess
       ts = rpm.TransactionSet()
       mi = ts.dbMatch()
       results = []
       for hdr in mi:
           name = hdr['name']
           if flatten:
                  results.append("%s" % (name))
proc = subprocess.Popen(['/bin/rpm -V '+ name], shell=True, stdout=subprocess.PIPE)
                  stdout_value = proc.communicate()[0]
                  results.append("%s\n" % (stdout_value))
           else:
                  results.append([name])
   return results
----------------------
To call the method, just
#func <minion> call rpms verify
or
#func <minion> call -a rpms verify

More information at:
http://zenit.senecac.on.ca/wiki/index.php/Func/Rpms_Module_-_Function_Verify#To_do_List

Or in my blog at:
http://miltonpaiva.wordpress.com
------------------------------------------------------------------------

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list


--
------------
Milton Paiva Neto
milton.paiva@xxxxxxxxx
mpaivaneto@xxxxxxxxxxxxxxxxxxx
http://miltonpaiva.wordpress.com/


_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux