Skip to content

Commit

Permalink
Merge pull request #1097 from sandialabs/slycatrc-guards
Browse files Browse the repository at this point in the history
adding guards for slycatrc file
  • Loading branch information
Mletter1 committed Feb 20, 2023
2 parents 335ee18 + 2307653 commit 569f567
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
3 changes: 2 additions & 1 deletion docker/compose/slycat-compose/docker-compose.yml
Expand Up @@ -38,7 +38,8 @@ services:
- bash
- -c
- |
NODE_TLS_REJECT_UNAUTHORIZED=0 npm install \
npm config set strict-ssl false \
&& NODE_TLS_REJECT_UNAUTHORIZED=0 npm install \
&& npm run dev
ports:
- 9000:9000
Expand Down
7 changes: 6 additions & 1 deletion packages/slycat/web/server/remote.py
Expand Up @@ -319,7 +319,12 @@ def get_user_config(self):
cherrypy.log.error("slycat.web.server.remote.py get_user_config",
"cherrypy.HTTPError 400 %s" % response["message"])
raise cherrypy.HTTPError(400)
return {"config": response["config"], "errors": response["errors"]}
if "config" in response:
return {"config": response["config"], "errors": response["errors"]}
else:
cherrypy.log.error("slycat.web.server.remote.py get_user_config",
"cherrypy.HTTPError 500 no slycat rc key from agent response")
raise cherrypy.HTTPError(500)
else:
cherrypy.response.headers["x-slycat-message"] = "No Slycat agent present on remote host."
cherrypy.log.error("slycat.web.server.remote.py get_user_config",
Expand Down
36 changes: 27 additions & 9 deletions web-server/components/timeseries-wizard/TimeseriesWizard.tsx
Expand Up @@ -347,15 +347,33 @@ export default class TimeseriesWizard extends React.Component<
if (this.state.visibleTab === '0' && this.state.selectedOption != 'hdf5') {
this.setState({ visibleTab: '1' }, () => {
client.get_user_config_fetch({ hostname: this.state.hostname })
.then((results) => {
this.setState({
numNodes: results["config"]["slurm"]["nnodes"], cores: results["config"]["slurm"]["ntasks-per-node"],
partition: results["config"]["slurm"]["partition"], jobHours: results["config"]["slurm"]["time-hours"],
jobMin: results["config"]["slurm"]["time-minutes"], accountId: results["config"]["slurm"]["wcid"],
workDir: results["config"]["slurm"]["workdir"], idCol: results["config"]["timeseries-wizard"]["id-column"],
delimiter: results["config"]["timeseries-wizard"]["inputs-file-delimiter"],
timeseriesColumn: results["config"]["timeseries-wizard"]["timeseries-name"]
});
.then((results: any) => {
if("config" in results && "slurm" in results["config"]){
if("timeseries-wizard" in results["config"]){
this.setState({
numNodes: results["config"]["slurm"]["nnodes"] ?? null,
cores: results["config"]["slurm"]["ntasks-per-node"] ?? null,
partition: results["config"]["slurm"]["partition"] ?? null,
jobHours: results["config"]["slurm"]["time-hours"] ?? null,
jobMin: results["config"]["slurm"]["time-minutes"] ?? null,
accountId: results["config"]["slurm"]["wcid"] ?? null,
workDir: results["config"]["slurm"]["workdir"] ?? null,
idCol: results["config"]["timeseries-wizard"]["id-column"] ?? null,
delimiter: results["config"]["timeseries-wizard"]["inputs-file-delimiter"] ?? null,
timeseriesColumn: results["config"]["timeseries-wizard"]["timeseries-name"] ?? null
});
} else {
this.setState({
numNodes: results["config"]["slurm"]["nnodes"] ?? null,
cores: results["config"]["slurm"]["ntasks-per-node"] ?? null,
partition: results["config"]["slurm"]["partition"] ?? null,
jobHours: results["config"]["slurm"]["time-hours"] ?? null,
jobMin: results["config"]["slurm"]["time-minutes"] ?? null,
accountId: results["config"]["slurm"]["wcid"] ?? null,
workDir: results["config"]["slurm"]["workdir"] ?? null
});
}
}
});
});
}
Expand Down

0 comments on commit 569f567

Please sign in to comment.