Skip to content

Commit

Permalink
compute/hpc: check for nil Task.Resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Buchanan committed May 17, 2018
1 parent 6bd1f44 commit 873966e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions compute/hpc_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,10 @@ func (b *HPCBackend) setupTemplatedHPCSubmit(task *tes.Task) (string, error) {
return "", err
}

res := task.GetResources()

var zone string
zones := task.Resources.GetZones()
zones := res.GetZones()
if zones != nil {
zone = zones[0]
}
Expand All @@ -259,9 +261,9 @@ func (b *HPCBackend) setupTemplatedHPCSubmit(task *tes.Task) (string, error) {
"Executable": funnelPath,
"Config": confPath,
"WorkDir": workdir,
"Cpus": int(task.Resources.CpuCores),
"RamGb": task.Resources.RamGb,
"DiskGb": task.Resources.DiskGb,
"Cpus": int(res.GetCpuCores()),
"RamGb": res.GetRamGb(),
"DiskGb": res.GetDiskGb(),
"Zone": zone,
})
if err != nil {
Expand Down

0 comments on commit 873966e

Please sign in to comment.