diff --git a/striker-ui-api/src/lib/accessModule.ts b/striker-ui-api/src/lib/accessModule.ts index c9d38cde..6d4707ba 100644 --- a/striker-ui-api/src/lib/accessModule.ts +++ b/striker-ui-api/src/lib/accessModule.ts @@ -147,7 +147,7 @@ const getLocalHostUUID = () => { subModuleName: 'Get', }).stdout; } catch (subError) { - throw new Error(`Failed to get local host UUID; CAUSE: ${subError}`); + throw new Error(`Failed to get localhost UUID; CAUSE: ${subError}`); } shout(`localHostUUID=[${result}]`); diff --git a/striker-ui-api/src/lib/request_handlers/host/getHost.ts b/striker-ui-api/src/lib/request_handlers/host/getHost.ts index 540e8cfa..e7335a2a 100644 --- a/striker-ui-api/src/lib/request_handlers/host/getHost.ts +++ b/striker-ui-api/src/lib/request_handlers/host/getHost.ts @@ -1,3 +1,5 @@ +import { LOCAL } from '../../consts/LOCAL'; + import { getLocalHostUUID } from '../../accessModule'; import buildGetRequestHandler from '../buildGetRequestHandler'; import { buildQueryHostDetail } from './buildQueryHostDetail'; @@ -21,7 +23,7 @@ export const getHost = buildGetRequestHandler((request, buildQueryOptions) => { if (output instanceof Array) { result = output.reduce>( (previous, [hostName, hostUUID]) => { - const key = hostUUID === localHostUUID ? 'local' : hostUUID; + const key = hostUUID === localHostUUID ? LOCAL : hostUUID; previous[key] = { hostName, hostUUID }; diff --git a/striker-ui-api/src/lib/request_handlers/host/getHostConnection.ts b/striker-ui-api/src/lib/request_handlers/host/getHostConnection.ts index 4013da64..2da4ae38 100644 --- a/striker-ui-api/src/lib/request_handlers/host/getHostConnection.ts +++ b/striker-ui-api/src/lib/request_handlers/host/getHostConnection.ts @@ -1,3 +1,5 @@ +import { LOCAL } from '../../consts/LOCAL'; + import { getAnvilData, getLocalHostUUID } from '../../accessModule'; import { buildUnknownIDCondition } from '../../buildCondition'; import buildGetRequestHandler from '../buildGetRequestHandler'; @@ -61,7 +63,7 @@ export const getHostConnection = buildGetRequestHandler( beforeBuildIDCond.length > 0 ? beforeBuildIDCond : [localHostUUID]; const getConnectionKey = (hostUUID: string) => - hostUUID === localHostUUID ? 'local' : hostUUID; + hostUUID === localHostUUID ? LOCAL : hostUUID; process.stdout.write(`condHostUUIDs=[${condHostUUIDs}]\n`); diff --git a/striker-ui-api/src/lib/request_handlers/ssh-key/getSSHKey.ts b/striker-ui-api/src/lib/request_handlers/ssh-key/getSSHKey.ts index a9e65604..1fc9f3af 100644 --- a/striker-ui-api/src/lib/request_handlers/ssh-key/getSSHKey.ts +++ b/striker-ui-api/src/lib/request_handlers/ssh-key/getSSHKey.ts @@ -1,3 +1,5 @@ +import { LOCAL } from '../../consts/LOCAL'; + import { getLocalHostUUID } from '../../accessModule'; import buildGetRequestHandler from '../buildGetRequestHandler'; import { buildQueryResultReducer } from '../../buildQueryResultModifier'; @@ -28,7 +30,7 @@ const MAP_TO_HANDLER: Record = { }; }; }>((previous, [hostName, hostUUID, stateName, stateNote, stateUUID]) => { - const hostUUIDKey = hostUUID === localHostUUID ? 'local' : hostUUID; + const hostUUIDKey = hostUUID === localHostUUID ? LOCAL : hostUUID; if (previous[hostUUIDKey] === undefined) { previous[hostUUIDKey] = {};