source: trunk/src/pxe_global.py.in @ 168

Last change on this file since 168 was 168, checked in by bas, 15 years ago

Added a common module for daemon and client:

  • src/pxe_global.py.in

src/pxeconfig.py:

  • removed some statements that are moved to pxe_global.py.in
  • Property svn:keywords set to Id URL
File size: 747 bytes
Line 
1#
2# Author: Bas van der Vlies
3# Date  : 19 Aug 2009
4# Desc. : Common functions for the daemon and client program
5#
6# SVN INFO
7#       $Id: pxe_global.py.in 168 2009-08-19 07:51:32Z bas $
8#       $URL: trunk/src/pxe_global.py.in $
9#
10import os
11import ConfigParser
12
13def ReadConfig():
14        """
15        Parse the config file
16        """
17        file = '@pxeconfig_conf@'
18
19        if not os.path.isfile(file):
20                error = 'File %s does not exist' %file
21                raise PxeConfig, error
22
23        config = ConfigParser.RawConfigParser()
24        try:
25                config.read(file)
26        except ConfigParser.MissingSectionHeaderError,detail:
27                raise PxeConfig, detail
28
29        # Not yet uses
30        #
31        #projects = {}
32        #for section in config.sections():
33        #       projects[section] = {}
34        #       for option in  config.options(section):
35        #       projects[section][option] = config.get(section, option)
36
37        stanza = config.defaults()
38        return stanza
Note: See TracBrowser for help on using the repository browser.