Skip to content

Commit 569f567

Browse files
authored
Merge pull request #1097 from sandialabs/slycatrc-guards
adding guards for slycatrc file
2 parents 335ee18 + 2307653 commit 569f567

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

docker/compose/slycat-compose/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ services:
3838
- bash
3939
- -c
4040
- |
41-
NODE_TLS_REJECT_UNAUTHORIZED=0 npm install \
41+
npm config set strict-ssl false \
42+
&& NODE_TLS_REJECT_UNAUTHORIZED=0 npm install \
4243
&& npm run dev
4344
ports:
4445
- 9000:9000

packages/slycat/web/server/remote.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,12 @@ def get_user_config(self):
319319
cherrypy.log.error("slycat.web.server.remote.py get_user_config",
320320
"cherrypy.HTTPError 400 %s" % response["message"])
321321
raise cherrypy.HTTPError(400)
322-
return {"config": response["config"], "errors": response["errors"]}
322+
if "config" in response:
323+
return {"config": response["config"], "errors": response["errors"]}
324+
else:
325+
cherrypy.log.error("slycat.web.server.remote.py get_user_config",
326+
"cherrypy.HTTPError 500 no slycat rc key from agent response")
327+
raise cherrypy.HTTPError(500)
323328
else:
324329
cherrypy.response.headers["x-slycat-message"] = "No Slycat agent present on remote host."
325330
cherrypy.log.error("slycat.web.server.remote.py get_user_config",

web-server/components/timeseries-wizard/TimeseriesWizard.tsx

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,33 @@ export default class TimeseriesWizard extends React.Component<
347347
if (this.state.visibleTab === '0' && this.state.selectedOption != 'hdf5') {
348348
this.setState({ visibleTab: '1' }, () => {
349349
client.get_user_config_fetch({ hostname: this.state.hostname })
350-
.then((results) => {
351-
this.setState({
352-
numNodes: results["config"]["slurm"]["nnodes"], cores: results["config"]["slurm"]["ntasks-per-node"],
353-
partition: results["config"]["slurm"]["partition"], jobHours: results["config"]["slurm"]["time-hours"],
354-
jobMin: results["config"]["slurm"]["time-minutes"], accountId: results["config"]["slurm"]["wcid"],
355-
workDir: results["config"]["slurm"]["workdir"], idCol: results["config"]["timeseries-wizard"]["id-column"],
356-
delimiter: results["config"]["timeseries-wizard"]["inputs-file-delimiter"],
357-
timeseriesColumn: results["config"]["timeseries-wizard"]["timeseries-name"]
358-
});
350+
.then((results: any) => {
351+
if("config" in results && "slurm" in results["config"]){
352+
if("timeseries-wizard" in results["config"]){
353+
this.setState({
354+
numNodes: results["config"]["slurm"]["nnodes"] ?? null,
355+
cores: results["config"]["slurm"]["ntasks-per-node"] ?? null,
356+
partition: results["config"]["slurm"]["partition"] ?? null,
357+
jobHours: results["config"]["slurm"]["time-hours"] ?? null,
358+
jobMin: results["config"]["slurm"]["time-minutes"] ?? null,
359+
accountId: results["config"]["slurm"]["wcid"] ?? null,
360+
workDir: results["config"]["slurm"]["workdir"] ?? null,
361+
idCol: results["config"]["timeseries-wizard"]["id-column"] ?? null,
362+
delimiter: results["config"]["timeseries-wizard"]["inputs-file-delimiter"] ?? null,
363+
timeseriesColumn: results["config"]["timeseries-wizard"]["timeseries-name"] ?? null
364+
});
365+
} else {
366+
this.setState({
367+
numNodes: results["config"]["slurm"]["nnodes"] ?? null,
368+
cores: results["config"]["slurm"]["ntasks-per-node"] ?? null,
369+
partition: results["config"]["slurm"]["partition"] ?? null,
370+
jobHours: results["config"]["slurm"]["time-hours"] ?? null,
371+
jobMin: results["config"]["slurm"]["time-minutes"] ?? null,
372+
accountId: results["config"]["slurm"]["wcid"] ?? null,
373+
workDir: results["config"]["slurm"]["workdir"] ?? null
374+
});
375+
}
376+
}
359377
});
360378
});
361379
}

0 commit comments

Comments
 (0)