Skip to content

Commit

Permalink
fix Graph.Dell.Configure.Idrac issue
Browse files Browse the repository at this point in the history
Graph.Dell.Configure.Idrac fails since it doesn't pass the parameters
to the setIdracIP function.
https://rackhd.atlassian.net/browse/RAC-6514
  • Loading branch information
lanchongyizu committed Mar 19, 2018
1 parent 0df7a66 commit c30a778
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 c30a778

Please sign in to comment.