Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7319

selmodule provider should only list modules once

    XMLWordPrintable

Details

    • Hide

      Selmodule provider no longer makes redundant queries to the operating system

      Show
      Selmodule provider no longer makes redundant queries to the operating system
    • Night's Watch
    • 2
    • ready for triage
    • Reviewed
    • Not Needed

    Description

      With a selmodule resource such as:

      selmodule { 'test': 
        ensure => present, 
        selmodulepath => '/usr/share/selinux/test.pp', 
        syncversion => true, 
      }
      

      The provider runs semodule --list twice, once for exists? and once for syncversion:

      Debug: Selmodule[test](provider=semodule): Checking for module test 
      Debug: Executing '/usr/sbin/semodule --list' 
      Debug: Selmodule[test](provider=semodule): Checking syncversion on test 
      Debug: Executing '/usr/sbin/semodule --list' 
      Debug: Selmodule[test](provider=semodule): load version 1.1 
      Debug: Selmodule[test](provider=semodule): file version 1.1 
      

      The semodule --list command takes around 2-3 seconds to execute, which causes a large performance hit when there are multiple selmodule resources.

      This impact could be cut in half if the command was only run once and the data cached for the syncversion function. It could be cut even more dramatically if semodule --list was stored as a fact and the output merely referenced in the provider.

      Attachments

        Issue Links

          Activity

            People

              branan Branan Riley
              adam.bottchen Adam Bottchen
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support