1

i want to umount a mounting point named VirtualDVD. i want to run the command, "gksudo umount VirtualDVD"

My function is:

def umount(self):
    '''unmounts VirtualDVD'''
    cmd = 'gksudo umount VirtualDVD'
    proc = subprocess.Popen(str(cmd), shell=True, stdout=subprocess.PIPE).stdout.read()
    print proc

i try "gksudo umount VirtualDVD" from terminal and everything is ok.

i try "gksudo umount VirtualDVD" from subprocess and it fails... it pops up the gksudo dialog and i can enter my password, but then it seems that umount fails because the VirtualDVD still is mounted. why?

demosthenes
  • 1,151
  • 1
  • 13
  • 17

1 Answers1

0

I figure it out... i should umount with complete path of mounting point. i changed the umount function as following and it works...

def umount(self):
    '''unmounts VirtualDVD'''
    #get virtualdvd folder
    home = QtCore.QDir.homePath()
    vpath = home + "/VirtualDVD"

    cmd = 'gksudo umount ' + vpath
    proc = subprocess.Popen(str(cmd), shell=True, stdout=subprocess.PIPE).stdout.read()
    print proc
demosthenes
  • 1,151
  • 1
  • 13
  • 17