Subversion Repositories SmartDukaan

Rev

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

Rev 3893 Rev 3896
Line 2... Line 2...
2
Created on 25-Oct-2011
2
Created on 25-Oct-2011
3
 
3
 
4
@author: Chandranshu
4
@author: Chandranshu
5
'''
5
'''
6
import logging
6
import logging
-
 
7
import subprocess
-
 
8
 
-
 
9
from shop2020.config.client.ConfigClient import ConfigClient
7
logging.basicConfig(level=logging.DEBUG)
10
logging.basicConfig(level=logging.DEBUG)
8
 
11
 
9
class ContentHandler:
12
class ContentHandler:
10
    '''
13
    '''
11
    classdocs
14
    classdocs
12
    '''
15
    '''
13
    
16
    
14
    def __init__(self):
17
    def __init__(self):
15
        pass
18
        try:
-
 
19
            config_client = ConfigClient()
-
 
20
            self.scriptPath = config_client.get_property('PUSH_PRICES_TO_PROD_SCRIPT_PATH')
-
 
21
        except:
-
 
22
            logging.error("Error while connecting to the config server")
-
 
23
            self.scriptPath = "/root/code/trunk/runutils/push-content-to-production.sh"
16
    
24
    
17
    def pushContentToProduction(self, entityId):
25
    def pushContentToProduction(self, entityId):
18
        """
26
        """
-
 
27
        Push the content of one entity to production
19
        Parameters:
28
        Parameters:
20
         - entityId
29
         - entityId
21
        """
30
        """
-
 
31
        retval = subprocess.call([self.scriptPath, entityId])
22
        pass
32
        if retval:
-
 
33
            raise Exception("Pushing content to production failed")
-
 
34
        return True
23
    
35
    
24
    def close_session(self):
36
    def close_session(self):
25
        pass
37
        pass
26
    
38
    
27
    def isAlive(self, ):
39
    def isAlive(self, ):