Skip to content

Commit

Permalink
bugfix: fail to execute repquota
Browse files Browse the repository at this point in the history
When fail to execute `reqquota`, return quota id is 0, instead of
`QuotaMinID`

Signed-off-by: Rudy Zhang <[email protected]>
  • Loading branch information
rudyfly committed Aug 20, 2018
1 parent 318aad0 commit fc34681
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions storage/quota/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/alibaba/pouch/pkg/exec"
"github.com/alibaba/pouch/pkg/kernel"

"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -289,9 +290,10 @@ func loadQuotaIDs(repquotaOpt string) (map[uint32]struct{}, uint32, error) {
quotaIDs := make(map[uint32]struct{}, 0)

minID := QuotaMinID
_, output, _, err := exec.Run(0, "repquota", repquotaOpt)
exit, output, stderr, err := exec.Run(0, "repquota", repquotaOpt)
if err != nil {
return nil, minID, err
return nil, 0, errors.Wrapf(err, "failed to execute [repquota %s], stdout: (%s), stderr: (%s), exit: (%d)",
repquotaOpt, output, stderr, exit)
}

lines := strings.Split(string(output), "\n")
Expand Down

0 comments on commit fc34681

Please sign in to comment.