Skip to content

Commit

Permalink
Find root disk by evaluating the root path
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Aug 6, 2023
1 parent ab816ce commit aaf6517
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/disk-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,9 @@ func (d *DiskManager) GetDiskByPartition(partition string) (Disk, error) {
func (d *DiskManager) GetCurrentDisk() (Disk, error) {
PrintVerbose("DiskManager.GetCurrentDisk: running...")

root, err := os.Getwd()
if err != nil {
PrintVerbose("DiskManager.GetCurrentDisk:err: %s", err)
return Disk{}, err
}

// we need to evaluate symlinks to get the real root path
// in case of weird setups
root, err = filepath.EvalSymlinks(root)
root, err := filepath.EvalSymlinks("/")
if err != nil {
PrintVerbose("DiskManager.GetCurrentDisk:err(2): %s", err)
return Disk{}, err
Expand Down

0 comments on commit aaf6517

Please sign in to comment.