Skip to content

Commit b8c0c45

Browse files
Railagdbusel
authored andcommitted
Merge (#436)
* fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413) (#424) * fix(bug) added registry email validation (EWC-418) * test(core) unit tests for iofog-controller (EWC-382) (#426) * test(core) unit tests for flow & diagnostics controllers, updated postman collection & refactored diagnostics (EWC-382) (#427) * bug(fix) CLI diagnostics: Incorrect error message is displayed when user try to get strace-info (#428) * test(core) unit tests for catalog, controller and agent controllers (EWC-382) (#430) * bug(fix) CLI diagnostics ftp: Incorrect error message is displayed when user try to get strace-info (EWC-431)
1 parent 35a2625 commit b8c0c45

File tree

8 files changed

+1213
-6
lines changed

8 files changed

+1213
-6
lines changed

src/decorators/authorization-decorator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ function checkFogToken(f) {
8686
module.exports = {
8787
checkAuthToken: checkAuthToken,
8888
checkFogToken: checkFogToken
89-
}
89+
};

src/schemas/agent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ const straceData = {
104104
"id": "/straceData",
105105
"type": "object",
106106
"properties": {
107-
"microserviceId": {"type": "string"},
107+
"microserviceUuid": {"type": "string"},
108108
"buffer": {"type": "string"}
109109
},
110-
"required": ["microserviceId", "buffer"],
110+
"required": ["microserviceUuid", "buffer"],
111111
"additionalProperties": false
112112
};
113113

src/sequelize/managers/strace-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class StraceManager extends BaseManager {
2626
return Strace
2727
}
2828

29-
async pushBufferByMicroserviceId(uuid, pushingData, transaction) {
29+
async pushBufferByMicroserviceUuid(uuid, pushingData, transaction) {
3030
const strace = await this.findOne({
3131
microserviceUuid: uuid
3232
}, transaction);

src/services/agent-service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ const updateAgentStrace = async function (straceData, fog, transaction) {
315315
await Validator.validate(straceData, Validator.schemas.updateAgentStrace);
316316

317317
for (const strace of straceData.straceData) {
318-
const microserviceId = strace.microserviceId;
318+
const microserviceUuid = strace.microserviceUuid;
319319
const buffer = strace.buffer;
320-
await StraceManager.pushBufferByMicroserviceId(microserviceId, buffer, transaction)
320+
await StraceManager.pushBufferByMicroserviceUuid(microserviceUuid, buffer, transaction)
321321
}
322322

323323
};

src/services/diagnostic-service.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ const getMicroserviceStraceData = async function (id, data, user, isCLI, transac
8080
const postMicroserviceStraceDatatoFtp = async function (id, data, user, isCLI, transaction) {
8181
await Validator.validate(data, Validator.schemas.stracePostToFtp);
8282
const straceData = await StraceDiagnosticManager.findOne({microserviceUuid: id}, transaction);
83+
84+
if (!straceData) {
85+
throw new Errors.NotFoundError(AppHelper.formatMessage(ErrorMessages.INVALID_MICROSERVICE_STRACE, id))
86+
}
87+
8388
const dir = config.get('Diagnostics:DiagnosticDir');
8489
const filePath = dir + '/' + id;
8590

0 commit comments

Comments
 (0)