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

inifile has no way to specify owner, group, or permission

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: wsus 0.1.3
    • Fix Version/s: None
    • Component/s: inifile

      Description

      ini_setting can create a new file if the path does not exist. There is no way to specify with the parameters what owner, group, and permission on the file. I currently have to do something like:

                                                                                
      define method_ini_setting(                                                      
        $ensure = present,                                                            
        $owner = undef,                                                               
        $group = undef,                                                               
        $mode = '0644',                                                               
        $path,                                                                        
        $section,                                                                     
        $setting,                                                                     
        $value,                                                                       
      ) {                                                                             
        validate_string($section, $setting)                                           
        validate_absolute_path($path)                                                  
                                                                                      
        ensure_resource('file', $path, {                                              
          ensure => present,                                                          
          owner  => $owner,                                                           
          group  => $group,                                                            
          mode   => $mode,                                                              
        })                                                                             
        File[$path] ->                                                                 
        ini_setting { $title:                                                          
          ensure  => $ensure,                                                          
          path    => $path,                                                            
          section => $section,                                                         
          setting => $setting,                                                         
          value   => $value,                                                           
        }                                                                              
      }                                                                                
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lavinia.foldenyi Lavinia Dan
                Reporter:
                rminsk Robert Minsk
              • Votes:
                3 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support