|
1 | | -import {spawn, spawnSync} from 'child_process'; |
| 1 | +import { spawn, spawnSync } from 'child_process'; |
2 | 2 | import config from '../../common/config'; |
3 | 3 | import Logger from '../../common/logger'; |
4 | | -import {Status} from '../../common/status'; |
| 4 | +import { Status } from '../../common/status'; |
5 | 5 |
|
6 | 6 | let logger = new Logger('ProcessController'); |
7 | 7 |
|
@@ -38,7 +38,7 @@ export default class ProcessController { |
38 | 38 |
|
39 | 39 | // Create ElastAlert index if it doesn't exist yet |
40 | 40 | logger.info('Creating index'); |
41 | | - var indexCreate = spawnSync('python', ['elastalert/create_index.py', '--index', 'elastalert_status', '--old-index', ''], { |
| 41 | + var indexCreate = spawnSync('python', ['-m', 'elastalert.create_index', '--index', 'elastalert_status', '--old-index', ''], { |
42 | 42 | cwd: this._elastalertPath |
43 | 43 | }); |
44 | 44 |
|
@@ -87,7 +87,7 @@ export default class ProcessController { |
87 | 87 |
|
88 | 88 | logger.info('Starting elastalert with arguments ' + (startArguments.join(' ') || '[none]')); |
89 | 89 |
|
90 | | - this._process = spawn('python', ['elastalert/elastalert.py'].concat(startArguments), { |
| 90 | + this._process = spawn('python', ['-m', 'elastalert.elastalert'].concat(startArguments), { |
91 | 91 | cwd: this._elastalertPath |
92 | 92 | }); |
93 | 93 |
|
|
0 commit comments