Subversion Repositories SmartDukaan

Rev

Rev 2926 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2926 Rev 3130
Line 14... Line 14...
14
    """
14
    """
15
        Implements Configserver stub from thrift.
15
        Implements Configserver stub from thrift.
16
    """
16
    """
17
    
17
    
18
    
18
    
19
    def __init__(self, path_to_cfg):
19
    def __init__(self, path_to_cfg, environment):
20
        """
20
        """
21
        Constructor takes file path info as parameter
21
        Constructor takes file path info as parameter
22
        """
22
        """
23
        if os.path.exists(path_to_cfg) == False:
23
        if os.path.exists(path_to_cfg) == False:
24
            self.cfg_path = '/tmp/shop2020.cfg'
24
            self.cfg_path = '/tmp/shop2020.cfg'
25
        else:
25
        else:
26
            self.cfg_path = path_to_cfg
26
            self.cfg_path = path_to_cfg
27
        
27
        
28
        #now load the configuration 
28
        #now load the configuration 
29
        self.config_parser = ConfigParser()
29
        self.config_parser = ConfigParser()
30
        self.section_name = "Config"
30
        self.section_name = environment
31
        self.initialized = False;
31
        self.initialized = False;
32
        try:
32
        try:
33
            read_ok = self.config_parser.read([self.cfg_path])
33
            read_ok = self.config_parser.read([self.cfg_path])
34
        except Exception, e:
34
        except Exception, e:
35
            print e;
35
            print e;