pf-tools commit: r882 [ccaillet-guest] - /branches/next-gen/lib/PFTools/Conf.pm

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Tue Sep 7 09:14:29 UTC 2010


Author: ccaillet-guest
Date: Tue Sep  7 09:14:09 2010
New Revision: 882

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=882
Log:
Cosmetic: Better like this

Modified:
    branches/next-gen/lib/PFTools/Conf.pm

Modified: branches/next-gen/lib/PFTools/Conf.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Conf.pm?rev=882&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Conf.pm (original)
+++ branches/next-gen/lib/PFTools/Conf.pm Tue Sep  7 09:14:09 2010
@@ -67,64 +67,67 @@
 
 #############################################################
 ### Default value for configuration with new method
-our $PF_CONFIG = {};
-$PF_CONFIG->{'path'} = {
-    'status_dir'     => '/var/lib/pftools',
-    'distrib_dir'    => '/distrib',
-    'tftp_dir'       => '/distrib/tftpboot',
-    'pxefiles_dir'   => '/distrib/tftpboot/pxelinux.cfg',
-    'global_struct'  => '/var/lib/pf-tools/global_struct.stor',
-    'deploy_docroot' => '/var/www',
-    'preseed_dir'    => '/var/www/preseed',
-    'checkout_dir'   => '/var/lib/cvsguest',
-    'templates_dir'  => '/usr/share/pf-tools/templates',
-    'common_config'  => 'update-common',
-    'start_file'     => 'private-network'
-};
-$PF_CONFIG->{'features'} = {
-    'ipv4'   => 1,
-    'ipv6'   => 0,
-    'update' => 1
-};
-$PF_CONFIG->{'vcs'} = {
-    'type'     => 'cvs',
-    'user'     => 'cvsguest',
-    'password' => '',
-    'method'   => 'rsh',
-    'rsh'      => '/usr/local/sbin/cvs_rsh',
-    'server'   => 'cvs.private',
-    'vcsroot'  => '/var/lib/cvs/repository',
-    'module'   => 'config',
-    'umask'    => '0077',
-    'command'  => '',
-    'branche'  => ''
-};
-$PF_CONFIG->{'debian'} = {
-    'preseed'          => 'standard-preseed',
-    'pxe'              => 'standard-installer',
-    'sources_list'     => 'sources.list',
-    'default_sections' => 'main contrib non-free',
-    'custom-sections'  => 'common',
-    'grub'             => '/boot/grub/menu.lst',
-    'grub2'            => '/etc/default/grub'
-};
-$PF_CONFIG->{'ubuntu'} = {
-    'preseed'          => 'ubuntu-preseed',
-    'pxe'              => 'ubuntu-installer',
-    'sources_list'     => 'ubuntu-sources.list',
-    'default_sections' => 'main universe restricted',
-    'custom-sections'  => 'common'
-};
-$PF_CONFIG->{'regex'} = {
-    'hostname_model' => $MODEL_CONFIG_REGEX,
-    'hostname'       => $HOST_CONFIG_REGEX,
-    'hosttype'       => $HOSTTYPE_CONFIG_REGEX,
-    'deploy_hosts'   => $DEPLOY_CONFIG_REGEX,
-    'network_fstype' => '(nfs|cifs)'
-};
-$PF_CONFIG->{'location'} = {
-    'site' => '',
-    'zone' => ''
+our $PF_CONFIG = {
+    'path' => {
+        'status_dir'     => '/var/lib/pftools',
+        'distrib_dir'    => '/distrib',
+        'tftp_dir'       => '/distrib/tftpboot',
+        'pxefiles_dir'   => '/distrib/tftpboot/pxelinux.cfg',
+        'global_struct'  => '/var/lib/pf-tools/global_struct.stor',
+        'deploy_docroot' => '/var/www',
+        'preseed_dir'    => '/var/www/preseed',
+        'checkout_dir'   => '/var/lib/cvsguest',
+        'templates_dir'  => '/usr/share/pf-tools/templates',
+        'common_config'  => 'update-common',
+        'start_file'     => 'private-network'
+    },
+    'features' => {
+        'ipv4'   => 1,
+        'ipv6'   => 0,
+        'update' => 1
+    },
+    'vcs' => {
+        'type'     => 'cvs',
+        'user'     => 'cvsguest',
+        'password' => '',
+        'method'   => 'rsh',
+        'rsh'      => '/usr/local/sbin/cvs_rsh',
+        'server'   => 'cvs.private',
+        'vcsroot'  => '/var/lib/cvs/repository',
+        'module'   => 'config',
+        'umask'    => '0077',
+        'command'  => '',
+        'branche'  => ''
+    },
+    'debian' => {
+        'preseed'          => 'standard-preseed',
+        'pxe'              => 'standard-installer',
+        'sources_list'     => 'sources.list',
+        'default_sections' => 'main contrib non-free',
+        'custom-sections'  => 'common',
+        'grub'             => '/boot/grub/menu.lst',
+        'grub2'            => '/etc/default/grub'
+    },
+    'ubuntu' => {
+        'preseed'          => 'ubuntu-preseed',
+        'pxe'              => 'ubuntu-installer',
+        'sources_list'     => 'ubuntu-sources.list',
+        'default_sections' => 'main universe restricted',
+        'custom-sections'  => 'common',
+        'grub'             => '/boot/grub/menu.lst',
+        'grub2'            => '/etc/default/grub'
+    },
+    'regex' => {
+        'hostname_model' => $MODEL_CONFIG_REGEX,
+        'hostname'       => $HOST_CONFIG_REGEX,
+        'hosttype'       => $HOSTTYPE_CONFIG_REGEX,
+        'deploy_hosts'   => $DEPLOY_CONFIG_REGEX,
+        'network_fstype' => '(nfs|cifs)'
+    },
+    'location' => {
+        'site' => '',
+        'zone' => ''
+    }
 };
 
 # Subst_vars
@@ -145,17 +148,15 @@
                 . $config_file
                 . " : no such file or directory" );
     }
-    if ( -r $config_file ) {
-        my ( $dev, $ino, $mode, $nlink, $uid, $gid, @lstat_vars )
-            = lstat($config_file);
+    my ( $dev, $ino, $mode, $nlink, $uid, $gid, @lstat_vars )
+        = lstat($config_file);
 
 # 		unless ( $uid == 0 && $gid == 0 && S_IMODE($mode) == 0600 && S_ISREG($mode) ) {
-        unless ( S_IMODE($mode) == 0600 && S_ISREG($mode) ) {
-            Abort( $CODE->{'RIGHTS'},
-                      "Ignoring weak rights for configuration file "
-                    . $config_file
-                    . " (check owner/group/mode)" );
-        }
+    unless ( S_IMODE($mode) == 0600 && S_ISREG($mode) ) {
+        Abort( $CODE->{'RIGHTS'},
+                  "Ignoring weak rights for configuration file "
+                . $config_file
+                . " (check owner/group/mode)" );
     }
 
     my $conf_parsed = Parser_ini($config_file);




More information about the pf-tools-commits mailing list