Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from dudyk/reregister
Browse files Browse the repository at this point in the history
Reregister existing framework and support escape of slash in task names
  • Loading branch information
tobilg authored Dec 1, 2016
2 parents 634374a + ba519a8 commit 3b74c66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ Scheduler.prototype.subscribe = function () {

}

} else {
res.on("data",function (chunk) {
if (chunk.length > 0)
self.logger.error("Error registering with mesos: " + chunk.toString());
});
}

});
Expand Down Expand Up @@ -353,7 +358,8 @@ Scheduler.prototype.subscribe = function () {
self.logger.info("SUBSCRIBE: " + JSON.stringify(Subscribe));

// Set the Call object
var Call = helpers.stringifyEnumsRecursive(new mesos.scheduler.Call(null, "SUBSCRIBE", Subscribe));
var Call = helpers.stringifyEnumsRecursive(new mesos.scheduler.Call(
self.frameworkId ? new mesos.FrameworkID(self.frameworkId) : null, "SUBSCRIBE", Subscribe));

// Write data to request body
self.request.write(JSON.stringify(Call));
Expand Down
2 changes: 1 addition & 1 deletion lib/schedulerHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = {
self.logger.debug("commandInfo after adding network info: " + JSON.stringify(helpers.stringifyEnumsRecursive(task.commandInfo)));

// Get unique taskId
var taskId = self.options.frameworkName + "." + task.name + "." + uuid.v4();
var taskId = self.options.frameworkName + "." + task.name.replace(/\//, "_") + "." + uuid.v4();

// Set taskId
task.taskId = taskId;
Expand Down

0 comments on commit 3b74c66

Please sign in to comment.