Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

# Copyright (C) 2010  Internet Systems Consortium. 

# 

# Permission to use, copy, modify, and distribute this software for any 

# purpose with or without fee is hereby granted, provided that the above 

# copyright notice and this permission notice appear in all copies. 

# 

# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM 

# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 

# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 

# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 

# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 

# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 

# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 

# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 

 

# This is a base-level module intended to provide configure-time 

# variables to python scripts and libraries. 

import os 

 

def reload(): 

    # In a function, for testing purposes 

    global BIND10_MSGQ_SOCKET_FILE 

    global DATA_PATH 

    global PLUGIN_PATHS 

    global PREFIX 

    global LIBEXECPATH 

    BIND10_MSGQ_SOCKET_FILE = os.path.join("${prefix}/var", 

                                           "bind10-devel", 

                                           "msgq_socket").replace("${prefix}", 

                                                                  "/home/jelte/opt/bind10") 

    PREFIX = "/home/jelte/opt/bind10" 

 

    # B10_FROM_SOURCE is set in the environment for internal tests and 

    # an experimental run without installagion.  In that case we need to 

    # specialize some configuration variables, generally so that they refer 

    # to somewhere in the source tree instead of the appropriate places 

    # after installation. 

    # 

    # DATA_PATH: used by the config manager to find configuration files. 

    #  When "FROM_SOURCE", we use data files from a directory relative to the 

    #  value of that variable, or, if defined, relative to the value of 

    #  B10_FROM_SOURCE_LOCALSTATEDIR.  Otherwise we use the ones installed on 

    #  the system. 

    # PLUGIN_PATHS: configuration modules that are not associated to specific 

    #  process 

    # LIBEXECPATH: Paths to programs invoked by the boss process 

    #  The boss process (directly or via a helper module) uses this as 

    #  the prefererred PATH before starting a child process. 

    #  When "FROM_SOURCE", it lists the directories where the programs are 

    #  built so that when BIND 10 is experimentally started on the source 

    #  tree the programs in the tree (not installed ones) will be used. 

    # 

    # B10_FROM_SOURCE_LOCALSTATEDIR is specifically intended to be used for 

    # tests where we want to use variuos types of configuration within the test 

    # environment.  (We may want to make it even more generic so that the path 

    # is passed from the boss process) 

    if "B10_FROM_SOURCE" in os.environ: 

59        if "B10_FROM_SOURCE_LOCALSTATEDIR" in os.environ: 

            DATA_PATH = os.environ["B10_FROM_SOURCE_LOCALSTATEDIR"] 

        else: 

            DATA_PATH = os.environ["B10_FROM_SOURCE"] 

        PLUGIN_PATHS = [os.environ["B10_FROM_SOURCE"] + 

                            '/src/bin/cfgmgr/plugins'] 

        programdirs = ['auth', 'cfgmgr', 'cmdctl', 'ddns', 'dhcp6', 'msgq', 

                       'resolver', 'sockcreator', 'stats', 'xfrin', 'xfrout', 

                       'zonemgr'] 

        LIBEXECPATH = ':'.join(['/home/jelte/repos/coverage_bind10/src/bin/' + p for p in 

                                programdirs]) 

    else: 

        DATA_PATH = "${prefix}/var/bind10-devel".replace("${prefix}", PREFIX) 

        PLUGIN_PATHS = ["/home/jelte/opt/bind10/share/bind10-devel/config_plugins"] 

        LIBEXECPATH = ("${exec_prefix}/libexec/bind10-devel"). \ 

            replace("${exec_prefix}", "${prefix}"). \ 

            replace("${prefix}", "/home/jelte/opt/bind10") 

    # For testing the plugins so they can find their own spec files 

    if "B10_TEST_PLUGIN_DIR" in os.environ: 

        PLUGIN_PATHS = os.environ["B10_TEST_PLUGIN_DIR"].split(':') 

 

reload()