Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!%(apppath)s/python/bin/python
- import signal
- from ZEO.ClientStorage import ClientStorage
- from ZODB import DB
- from ZPublisher.HTTPResponse import HTTPResponse
- from ZPublisher.HTTPRequest import HTTPRequest
- from ZPublisher.BaseRequest import RequestContainer
- from Products.BSBDeployTool.DeployTool import deploymentPoll
- # Hotfix
- import Products.BSBDeployTool.DeployTool
- Products.BSBDeployTool.DeployTool.ENVIRONMENT_CONFIG = 'Products/BSBDeployTool/environments.conf'
- run = True
- def signal_interrupt(signum, frame):
- global run
- run = False
- signal.signal(signal.SIGINT, signal_interrupt)
- def run_callback():
- global run
- return run
- def getContext(app):
- resp = HTTPResponse(stdout=None)
- env = {
- 'SERVER_NAME':'web-cms-edit.%(env)s.internal',
- 'SERVER_PORT':'8080',
- 'REQUEST_METHOD':'GET'
- }
- req = HTTPRequest(None, env, resp)
- return app.__of__(RequestContainer(REQUEST = req))
- def begin():
- sharedstorage = ClientStorage(('web-cms-zeo.%(env)s.internal', 9100), storage='shared-state', wait=True)
- shareddb = DB(sharedstorage)
- sharedconn = shareddb.open()
- sharedroot = sharedconn.root()
- app = sharedroot['Application']
- ctx = getContext(app)
- deploymentPoll(ctx, run_callback)
- if __name__ == '__main__':
- begin()
Add Comment
Please, Sign In to add comment