Subversion Repositories SmartDukaan

Rev

Rev 3915 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3915 Rev 4667
Line 23... Line 23...
23
    def __init__(self, logfile='/var/log/services/promotion.log', pidfile='/tmp/promotion-server.pid'):
23
    def __init__(self, logfile='/var/log/services/promotion.log', pidfile='/tmp/promotion-server.pid'):
24
        Daemon.__init__(self, pidfile, stdout=logfile, stderr=logfile)
24
        Daemon.__init__(self, pidfile, stdout=logfile, stderr=logfile)
25
 
25
 
26
    def run(self):
26
    def run(self):
27
        #get the config client
27
        #get the config client
28
        try:
-
 
29
            config_client = ConfigClient()
28
        config_client = ConfigClient()
30
            host_name = config_client.get_property('promotion_service_server_host')
29
        host_name = config_client.get_property('promotion_service_server_host')
31
            port = config_client.get_property('promotion_service_server_port')
30
        port = config_client.get_property('promotion_service_server_port')
32
            dbname = config_client.get_property('promotion_service_dbname')
31
        dbname = config_client.get_property('promotion_service_dbname')
33
            db_hostname = config_client.get_property('promotion_service_db_hostname')
32
        db_hostname = config_client.get_property('promotion_service_db_hostname')
34
        except:
-
 
35
            #error while spawning the config server
-
 
36
            host_name = 'localhost'
-
 
37
            port = 9005
-
 
38
            dbname = 'user'
-
 
39
            db_hostname='localhost'
-
 
40
        
33
        
41
        handler = PromotionServiceHandler(dbname, db_hostname)
34
        handler = PromotionServiceHandler(dbname, db_hostname)
42
        processor = PromotionService.Processor(handler)
35
        processor = PromotionService.Processor(handler)
43
        transport = TSocket.TServerSocket(port=port)
36
        transport = TSocket.TServerSocket(port=port)
44
        tfactory = TTransport.TFramedTransportFactory()
37
        tfactory = TTransport.TFramedTransportFactory()