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

selmodule provider should only list modules once

    Details

    • Template:
    • Acceptance Criteria:
      Hide

      Selmodule provider no longer makes redundant queries to the operating system

      Show
      Selmodule provider no longer makes redundant queries to the operating system
    • Team:
      Platform OS
    • Story Points:
      2
    • CS Priority:
      Reviewed

      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

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                branan Branan Riley
                Reporter:
                adam.bottchen Adam Bottchen
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Zendesk Support