From 8ab0494ae0ee1e453bb1ea841c96696a62fed0d2 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Tue, 8 Aug 2023 18:42:09 -0400 Subject: [PATCH] fix(striker-ui-api): correct job data creation in prepare host --- .../lib/request_handlers/host/prepareHost.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/striker-ui-api/src/lib/request_handlers/host/prepareHost.ts b/striker-ui-api/src/lib/request_handlers/host/prepareHost.ts index 326718af..65052d4e 100644 --- a/striker-ui-api/src/lib/request_handlers/host/prepareHost.ts +++ b/striker-ui-api/src/lib/request_handlers/host/prepareHost.ts @@ -10,6 +10,7 @@ import { } from '../../consts'; import { job, variable } from '../../accessModule'; +import { buildJobDataFromObject } from '../../buildJobData'; import { sanitize } from '../../sanitize'; import { stderr } from '../../shell'; @@ -124,14 +125,18 @@ export const prepareHost: RequestHandler< await job({ file: __filename, job_command: SERVER_PATHS.usr.sbin['striker-initialize-host'].self, - job_data: `enterprise_uuid=${dataEnterpriseUUID} -host_ip_address=${dataHostIPAddress} -host_name=${dataHostName} -password=${dataHostPassword} -rh_password=${dataRedhatPassword} -rh_user=${dataRedhatUser} -ssh_port=${dataHostSSHPort} -type=${dataHostType}`, + job_data: buildJobDataFromObject({ + obj: { + enterprise_uuid: dataEnterpriseUUID, + host_ip_address: dataHostIPAddress, + host_name: dataHostName, + password: dataHostPassword, + rh_password: dataRedhatPassword, + rh_user: dataRedhatUser, + ssh_port: dataHostSSHPort, + type: dataHostType, + }, + }), job_description: 'job_0022', job_name: `initialize::${dataHostType}::${dataHostIPAddress}`, job_title: `job_002${dataHostType === 'dr' ? '1' : '0'}`,