Skip to content

Commit

Permalink
cmd: Code improvement
Browse files Browse the repository at this point in the history
Signed-off-by: Zhou Hao <[email protected]>

Closes: #843
Approved by: rhatdan
  • Loading branch information
Zhou Hao authored and rh-atomic-bot committed Jul 2, 2018
1 parent 5cd9be6 commit 5c11c34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions cmd/buildah/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (

"github.com/pkg/errors"
"github.com/projectatomic/buildah/pkg/parse"
"github.com/projectatomic/buildah/util"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)

Expand Down Expand Up @@ -49,17 +47,17 @@ func mountCmd(c *cli.Context) error {
builder, err := openBuilder(getContext(), store, name)
if err != nil {
if lastError != nil {
logrus.Error(lastError)
fmt.Fprintln(os.Stderr, lastError)
}
lastError = util.WriteError(os.Stderr, errors.Wrapf(err, "error reading build container %q", name), lastError)
lastError = errors.Wrapf(err, "error reading build container %q", name)
continue
}
mountPoint, err := builder.Mount(builder.MountLabel)
if err != nil {
if lastError != nil {
logrus.Error(lastError)
fmt.Fprintln(os.Stderr, lastError)
}
lastError = util.WriteError(os.Stderr, errors.Wrapf(err, "error mounting %q container %q", name, builder.Container), lastError)
lastError = errors.Wrapf(err, "error mounting %q container %q", name, builder.Container)
continue
}
if len(args) > 1 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildah/umount.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
Usage: "Unmounts the root file system on the specified working containers",
Description: "Unmounts the root file system on the specified working containers",
Action: umountCmd,
ArgsUsage: "CONTAINER-NAME-OR-ID [...]",
ArgsUsage: "[CONTAINER-NAME-OR-ID [...]]",
Flags: umountFlags,
SkipArgReorder: true,
}
Expand Down
2 changes: 1 addition & 1 deletion docs/buildah-umount.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
buildah\-umount - Unmount the root file system on the specified working containers.

## SYNOPSIS
**buildah umount** *container* ...
**buildah umount** [*options*] [*container* ...]

## DESCRIPTION
Unmounts the root file system on the specified working containers.
Expand Down

0 comments on commit 5c11c34

Please sign in to comment.