Skip to content

Commit

Permalink
Fixing small issues and updating Docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Reed committed Nov 2, 2017
1 parent 438854f commit aa479e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Expand Up @@ -19,8 +19,7 @@ WORKDIR /home/docker/hpe-oneview-hubot

RUN cp -rf /home/docker/hubot-core-org/node_modules/ /home/docker/hpe-oneview-hubot/

COPY gulpfile.babel.js /home/docker/hpe-oneview-hubot/
COPY gulpfile.js /home/docker/hpe-oneview-hubot/
COPY src /home/docker/hpe-oneview-hubot/src/
COPY .babelrc /home/docker/hpe-oneview-hubot/

ENTRYPOINT ["sh", "/usr/local/bin/docker_entry.sh"]
15 changes: 2 additions & 13 deletions Dockerfile-core
Expand Up @@ -34,7 +34,7 @@ RUN apk --no-cache add \
sudo \
bash \
php5-curl
#RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
#RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
#RUN apk add --no-cache aptitude
#RUN aptitude install -y
RUN apk --no-cache add \
Expand Down Expand Up @@ -68,7 +68,6 @@ RUN npm install -g minimatch@^3.0.2; \
npm install -g graceful-fs@^4.0.0;

RUN npm install gulp; \
npm install gulp-babel@^6.1.2; \
npm install gulp-task-listing@^1.0.1;

# To install avoid cross-device link not permitted...
Expand All @@ -80,7 +79,6 @@ USER docker


RUN npm install hubot@2.x \
hubot-test-helper@^1.3.0 \
amqp@^0.2.6 \
d3@^4.2.7 \
jsdom@^9.8.0 \
Expand All @@ -91,9 +89,7 @@ RUN npm install hubot@2.x \
request-promise@^4.1.1;


RUN npm install babel-plugin-transform-function-bind; \
npm install babel-preset-es2015@^6.16.0; \
npm install del@^2.2.2;
RUN npm install del@^2.2.2;

###############################################################################
USER root
Expand All @@ -113,12 +109,10 @@ RUN npm install minimatch@^3.0.2; \
RUN npm install -g gulp; \
npm install; \
npm install gulp; \
npm install gulp-babel@^6.1.2; \
npm install gulp-task-listing@^1.0.1; \
npm install gulp-util@^3.0.7

RUN npm install hubot@2.x \
hubot-test-helper@^1.3.0 \
amqp@^0.2.6 \
d3@^4.2.7 \
jsdom@^9.8.0 \
Expand All @@ -127,10 +121,6 @@ RUN npm install hubot@2.x \
nlp_compromise@^6.5.0 \
request@^2.75.0 \
request-promise@^4.1.1 \
babel-core \
babel-plugin-transform-function-bind \
babel-preset-es2015@^6.16.0 \
babel-register \
del@^2.2.2;


Expand All @@ -144,4 +134,3 @@ COPY docker_entry.sh /usr/local/bin/
COPY docker_go.sh /go.sh

ENTRYPOINT ["sh", "/usr/local/bin/docker_entry.sh"]

10 changes: 5 additions & 5 deletions src/listener/server-profile-templates.js
Expand Up @@ -70,7 +70,7 @@ class ServerProfileTemplateListener extends Listener {

GetAvailableTargets(msg) {
let template = null;
__getAvailableTargets__(msg, (spt) => { template = spt; }).then((targets) => {
__getAvailableTargets__(msg, (spt) => { template = spt; }, this.client).then((targets) => {
if (targets && targets.length > 0) {
return this.transform.send(msg, targets, "I was able to dig up " + this.transform.makePlural(targets.length, 'server') + ' for ' + this.transform.hyperlink(template.hyperlink, template.name));
} else {
Expand Down Expand Up @@ -102,7 +102,7 @@ class ServerProfileTemplateListener extends Listener {

dialog.addChoice(/yes/i, () => {
let template = null;
__getAvailableTargets__(msg, (spt) => { template = spt; }).then((targets) => {
__getAvailableTargets__(msg, (spt) => { template = spt; }, this.client).then((targets) => {
let i = -1;
return targets.filter((t) => {
if (t.powerState === 'Off') {
Expand Down Expand Up @@ -254,11 +254,11 @@ class ServerProfileTemplateListener extends Listener {
}
}

function __getAvailableTargets__(msg, target) {
function __getAvailableTargets__(msg, target, client) {
let host = msg.host;
return this.client.ServerProfileTemplates.getAvailableTargets(msg.host, msg.templateId, target).then((targets) => {
return client.ServerProfileTemplates.getAvailableTargets(msg.host, msg.templateId, target).then((targets) => {
if (targets.length > 0) {
return Promise.allSettled(targets.map((t) => { return this.client.ServerHardware.getServerHardware(host, t.serverHardwareUri); }));
return Promise.allSettled(targets.map((t) => { return client.ServerHardware.getServerHardware(host, t.serverHardwareUri); }));
} else {
return [];
}
Expand Down

0 comments on commit aa479e0

Please sign in to comment.