Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hashicorp/nomad
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Mar 10, 2016
2 parents 0e25872 + 05c8044 commit 7325873
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions command/fs_cat.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ func (f *FSCatCommand) Run(args []string) int {
}
}

if alloc.DesiredStatus == "failed" {
allocID := limit(alloc.ID, length)
msg := fmt.Sprintf(`The allocation %q failed to be placed. To see the cause, run:
nomad alloc-status %s`, allocID, allocID)
f.Ui.Error(msg)
return 0
}
// Stat the file to find it's size
file, _, err := client.AllocFS().Stat(alloc, path, nil)
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions command/fs_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ func (f *FSListCommand) Run(args []string) int {
}
}

if alloc.DesiredStatus == "failed" {
allocID := limit(alloc.ID, length)
msg := fmt.Sprintf(`The allocation %q failed to be placed. To see the cause, run:
nomad alloc-status %s`, allocID, allocID)
f.Ui.Error(msg)
return 0
}
// Get the file at the given path
files, _, err := client.AllocFS().List(alloc, path, nil)
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions command/fs_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ func (f *FSStatCommand) Run(args []string) int {
}
}

if alloc.DesiredStatus == "failed" {
allocID := limit(alloc.ID, length)
msg := fmt.Sprintf(`The allocation %q failed to be placed. To see the cause, run:
nomad alloc-status %s`, allocID, allocID)
f.Ui.Error(msg)
return 0
}
// Get the file information
file, _, err := client.AllocFS().Stat(alloc, path, nil)
if err != nil {
Expand Down

0 comments on commit 7325873

Please sign in to comment.