Skip to content

Commit

Permalink
many: rename StripGlobalRootDir to StripRootDir
Browse files Browse the repository at this point in the history
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga committed Aug 24, 2016
1 parent 04b09b4 commit 05bc35a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dirs/dirs.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func init() {
SetRootDir(root)
}

// StripGlobalRootDir strips the custom global root directory from the specified argument.
func StripGlobalRootDir(dir string) string {
// StripRootDir strips the custom global root directory from the specified argument.
func StripRootDir(dir string) string {
if GlobalRootDir == "/" {
return dir
}
Expand Down
6 changes: 3 additions & 3 deletions overlord/snapstate/backend/mountunit.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
)

func addMountUnit(s *snap.Info, meter progress.Meter) error {
squashfsPath := dirs.StripGlobalRootDir(s.MountFile())
whereDir := dirs.StripGlobalRootDir(s.MountDir())
squashfsPath := dirs.StripRootDir(s.MountFile())
whereDir := dirs.StripRootDir(s.MountDir())

sysd := systemd.New(dirs.GlobalRootDir, meter)
mountUnitName, err := sysd.WriteMountUnitFile(s.Name(), squashfsPath, whereDir, "squashfs")
Expand All @@ -56,7 +56,7 @@ func addMountUnit(s *snap.Info, meter progress.Meter) error {

func removeMountUnit(baseDir string, meter progress.Meter) error {
sysd := systemd.New(dirs.GlobalRootDir, meter)
unit := systemd.MountUnitPath(dirs.StripGlobalRootDir(baseDir), "mount")
unit := systemd.MountUnitPath(dirs.StripRootDir(baseDir), "mount")
if osutil.FileExists(unit) {
if err := sysd.Stop(filepath.Base(unit), time.Duration(1*time.Second)); err != nil {
return err
Expand Down

0 comments on commit 05bc35a

Please sign in to comment.