Skip to content

Commit

Permalink
Merge pull request #589 from lanchongyizu/bugfix/RAC-6514
Browse files Browse the repository at this point in the history
fix Graph.Dell.Configure.Idrac issue
  • Loading branch information
lanchongyizu authored Mar 20, 2018
2 parents 0df7a66 + c30a778 commit d085c7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/jobs/racadm-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ function racadmToolJobFactory(

this.nodeId = this.context.target;
this.action = options.action;
this.userConfig = {user: options.serverUsername, password: options.serverPassword,
this.userConfig = {user: options.serverUsername, password: options.serverPassword,
filePath: options.serverFilePath};
if (typeof options.forceReboot !== "undefined") {
this.userConfig.forceReboot = options.forceReboot;
}
if (typeof options.components !== "undefined") {
this.userConfig = options.components;
}
if (typeof options.ip !== "undefined") {
this.userConfig.ip = options.ip;
this.userConfig.netMask = options.netMask;
this.userConfig.gateway = options.gateway;
}
}
util.inherits(RacadmToolJob, BaseJob);

Expand Down
3 changes: 2 additions & 1 deletion lib/utils/job-utils/racadm-tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,12 @@ function racadmFactory(
* @return {promise}
*/
RacadmTool.prototype.setIdracIP = function(host, user, password, data) {
var self = this;
return Promise.try(function(){
if (Constants.Regex.IpAddress.test(data.ip) &&
Constants.Regex.IpAddress.test(data.netMask) &&
Constants.Regex.IpAddress.test(data.gateway)) {
return this.runCommand(host, user, password,
return self.runCommand(host, user, password,
"setniccfg -s " + data.ip + " " + data.netMask + " " + data.gateway);
}else{
throw new Errors.MyError('Invalid format of the input');
Expand Down

0 comments on commit d085c7a

Please sign in to comment.