fix(striker-ui-api): remove console calls

main
Tsu-ba-me 2 years ago
parent 32ecfec762
commit c4232916f9
  1. 3
      striker-ui-api/src/lib/request_handlers/anvil/buildQueryAnvilDetail.ts
  2. 3
      striker-ui-api/src/lib/request_handlers/file/buildQueryFileDetail.ts
  3. 16
      striker-ui-api/src/lib/request_handlers/host/configStriker.ts
  4. 3
      striker-ui-api/src/lib/request_handlers/server/getServer.ts

@ -2,6 +2,7 @@ import NODE_AND_DR_RESERVED_MEMORY_SIZE from '../../consts/NODE_AND_DR_RESERVED_
import { OS_LIST } from '../../consts/OS_LIST'; import { OS_LIST } from '../../consts/OS_LIST';
import join from '../../join'; import join from '../../join';
import { stdoutVar } from '../../shell';
const buildQueryAnvilDetail = ({ const buildQueryAnvilDetail = ({
anvilUUIDs = ['*'], anvilUUIDs = ['*'],
@ -19,7 +20,7 @@ const buildQueryAnvilDetail = ({
separator: ', ', separator: ', ',
}); });
console.log(`condAnvilsUUID=[${condAnvilsUUID}]`); stdoutVar({ condAnvilsUUID });
const buildHostQuery = ({ const buildHostQuery = ({
isSummary = false, isSummary = false,

@ -1,4 +1,5 @@
import join from '../../join'; import join from '../../join';
import { stdoutVar } from '../../shell';
const buildQueryFileDetail = ({ const buildQueryFileDetail = ({
fileUUIDs = ['*'], fileUUIDs = ['*'],
@ -14,7 +15,7 @@ const buildQueryFileDetail = ({
separator: ', ', separator: ', ',
}); });
console.log(`condFilesUUID=[${condFileUUIDs}]`); stdoutVar({ condFileUUIDs });
return ` return `
SELECT SELECT

@ -10,6 +10,7 @@ import {
import SERVER_PATHS from '../../consts/SERVER_PATHS'; import SERVER_PATHS from '../../consts/SERVER_PATHS';
import { job } from '../../accessModule'; import { job } from '../../accessModule';
import { stderr, stdoutVar } from '../../shell';
const fvar = (configStepCount: number, fieldName: string) => const fvar = (configStepCount: number, fieldName: string) =>
['form', `config_step${configStepCount}`, fieldName, 'value'].join('::'); ['form', `config_step${configStepCount}`, fieldName, 'value'].join('::');
@ -40,8 +41,7 @@ export const configStriker: RequestHandler<
undefined, undefined,
InitializeStrikerForm InitializeStrikerForm
> = ({ body }, response) => { > = ({ body }, response) => {
console.log('Begin initialize Striker.'); stdoutVar(body, 'Begin initialize Striker; body=');
console.dir(body, { depth: null });
const { const {
adminPassword = '', adminPassword = '',
@ -105,13 +105,11 @@ export const configStriker: RequestHandler<
`Data organization prefix can only contain 1 to 5 lowercase alphanumeric characters; got [${dataOrganizationPrefix}]`, `Data organization prefix can only contain 1 to 5 lowercase alphanumeric characters; got [${dataOrganizationPrefix}]`,
); );
} catch (assertError) { } catch (assertError) {
console.log( stderr(
`Failed to assert value when trying to initialize striker; CAUSE: ${assertError}.`, `Failed to assert value when trying to initialize striker; CAUSE: ${assertError}.`,
); );
response.status(400).send(); return response.status(400).send();
return;
} }
try { try {
@ -153,11 +151,9 @@ ${buildNetworkLinks(2, networkShortName, interfaces)}`;
job_description: 'job_0071', job_description: 'job_0071',
}); });
} catch (subError) { } catch (subError) {
console.log(`Failed to queue striker initialization; CAUSE: ${subError}`); stderr(`Failed to queue striker initialization; CAUSE: ${subError}`);
response.status(500).send();
return; return response.status(500).send();
} }
response.status(200).send(); response.status(200).send();

@ -1,6 +1,7 @@
import buildGetRequestHandler from '../buildGetRequestHandler'; import buildGetRequestHandler from '../buildGetRequestHandler';
import join from '../../join'; import join from '../../join';
import { sanitize } from '../../sanitize'; import { sanitize } from '../../sanitize';
import { stdoutVar } from '../../shell';
export const getServer = buildGetRequestHandler( export const getServer = buildGetRequestHandler(
(request, buildQueryOptions) => { (request, buildQueryOptions) => {
@ -13,7 +14,7 @@ export const getServer = buildGetRequestHandler(
separator: ', ', separator: ', ',
}); });
console.log(`condAnvilsUUID=[${condAnvilUUIDs}]`); stdoutVar({ condAnvilUUIDs });
if (buildQueryOptions) { if (buildQueryOptions) {
buildQueryOptions.afterQueryReturn = (queryStdout) => { buildQueryOptions.afterQueryReturn = (queryStdout) => {

Loading…
Cancel
Save