yumcmd - list of installed packages -

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

 



Hi,

Just an idea.
It could be interesting to add a function in the Func yumcmd module to list the installed rpm packages on minions.
Just to avoid unattended problem due to missing packages on minion during the execution of the module.
 
See below for a example of what I have develop for the moment for my module.
Well, it should be in the Func yumcmd module and not in my module.
Just follow the rule : Do not reinvent the wheel ! :)

    def __mysql_python_package_list(self,rc):
         rc = 1
         pkg = {}
         installed_pkg = 1
         ayum = yum.YumBase()
         ayum.conf.cache = os.geteuid() != 1
         pkg_list = ayum.doPackageLists(patterns=sys.argv[1:])
         if pkg_list.installed:
             for pkg in pkg_list.installed:
                  (n, a, e, v, r) = pkg.pkgtup
                  if n == "MySQL-python":
                      installed_pkg = 0
             if installed_pkg == 1:
                  rc = 1
             else:
                  rc = 0
         return rc


Frederic Hornain
-----------------------------------------------------
Fedora-ambassadors-list mailing list
Fedora-ambassadors-list@xxxxxxxxxx
_______________________________________________
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