Skip to content

Commit 33c94b9

Browse files
author
Khanh Nguyen
committed
Spawns elastalert python scripts with module
1 parent c537ca6 commit 33c94b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/controllers/process/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {spawn, spawnSync} from 'child_process';
1+
import { spawn, spawnSync } from 'child_process';
22
import config from '../../common/config';
33
import Logger from '../../common/logger';
4-
import {Status} from '../../common/status';
4+
import { Status } from '../../common/status';
55

66
let logger = new Logger('ProcessController');
77

@@ -38,7 +38,7 @@ export default class ProcessController {
3838

3939
// Create ElastAlert index if it doesn't exist yet
4040
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', ''], {
4242
cwd: this._elastalertPath
4343
});
4444

@@ -87,7 +87,7 @@ export default class ProcessController {
8787

8888
logger.info('Starting elastalert with arguments ' + (startArguments.join(' ') || '[none]'));
8989

90-
this._process = spawn('python', ['elastalert/elastalert.py'].concat(startArguments), {
90+
this._process = spawn('python', ['-m', 'elastalert.elastalert'].concat(startArguments), {
9191
cwd: this._elastalertPath
9292
});
9393

0 commit comments

Comments
 (0)