fix(striker-ui-api): correct job data creation in prepare host

main
Tsu-ba-me 1 year ago
parent 98eec8a10c
commit 8ab0494ae0
  1. 21
      striker-ui-api/src/lib/request_handlers/host/prepareHost.ts

@ -10,6 +10,7 @@ import {
} from '../../consts'; } from '../../consts';
import { job, variable } from '../../accessModule'; import { job, variable } from '../../accessModule';
import { buildJobDataFromObject } from '../../buildJobData';
import { sanitize } from '../../sanitize'; import { sanitize } from '../../sanitize';
import { stderr } from '../../shell'; import { stderr } from '../../shell';
@ -124,14 +125,18 @@ export const prepareHost: RequestHandler<
await job({ await job({
file: __filename, file: __filename,
job_command: SERVER_PATHS.usr.sbin['striker-initialize-host'].self, job_command: SERVER_PATHS.usr.sbin['striker-initialize-host'].self,
job_data: `enterprise_uuid=${dataEnterpriseUUID} job_data: buildJobDataFromObject({
host_ip_address=${dataHostIPAddress} obj: {
host_name=${dataHostName} enterprise_uuid: dataEnterpriseUUID,
password=${dataHostPassword} host_ip_address: dataHostIPAddress,
rh_password=${dataRedhatPassword} host_name: dataHostName,
rh_user=${dataRedhatUser} password: dataHostPassword,
ssh_port=${dataHostSSHPort} rh_password: dataRedhatPassword,
type=${dataHostType}`, rh_user: dataRedhatUser,
ssh_port: dataHostSSHPort,
type: dataHostType,
},
}),
job_description: 'job_0022', job_description: 'job_0022',
job_name: `initialize::${dataHostType}::${dataHostIPAddress}`, job_name: `initialize::${dataHostType}::${dataHostIPAddress}`,
job_title: `job_002${dataHostType === 'dr' ? '1' : '0'}`, job_title: `job_002${dataHostType === 'dr' ? '1' : '0'}`,

Loading…
Cancel
Save