Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 18 lines (12 sloc) 0.66 kb
0ff7d7c Andrei Dziahel fixed typos, removed obsolete imports
develop7 authored
1 from iron_worker import *
7fa2629 Andrei Dziahel pagerduty example: initial python implementation
develop7 authored
2
3 import pagerduty
4 import shutil
5
25ff7a7 Andrei Dziahel pagerduty example: typo fixed
develop7 authored
6 #here we have to include pagerduty library with worker.
7fa2629 Andrei Dziahel pagerduty example: initial python implementation
develop7 authored
7 worker_dir = os.path.dirname(__file__) + '/pagerduty'
8 pd_dir = os.path.dirname(pagerduty.__file__)
9 shutil.copytree(pd_dir, worker_dir + '/pagerduty') #copy it to worker directory
10
11 payload = {'pagerduty': {'service_key': PAGERDUTY_SERVICE_KEY}}
12
13 worker = IronWorker(config='config.ini')
14 IronWorker.zipDirectory(directory=worker_dir, destination='pagerduty-py.zip', overwrite=True)
15
16 res = worker.postCode(runFilename='pagerduty.py', zipFilename='pagerduty-py.zip', name='pagerduty-py')
17
18 task = worker.postTask(name='pagerduty-py', payload=payload)
Something went wrong with that request. Please try again.