udisks FilesystemUnmount appears to not exist when calling from python
Question: I'm trying to unmount a filesystem that I mounted using FilesystemMount, but I
keep getting UnknownMethod exceptions. I've verified that I can call the
method on the Device interface via D-Feet, but trying to do it via dbus
directly doesn't appear to work at all. I've tried using the following
arguments:

  * ''
  * None
  * []
  * ['']

The following code demonstrates the problem:

    
    
    import dbus
    
    bus = dbus.SystemBus()
    proxy = bus.get_object('org.freedesktop.UDisks', '/dev/fd0')
    dev = dbus.Interface(proxy, 'org.freedesktop.UDisks.Device')
    dev.FilesystemUnmount(['force'])
    

Exception:

`dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod:
Method "FilesystemUmount" with signature "as" on interface
"org.freedesktop.UDisks.Device" doesn't exist`


Answer: Turns out that the problem is that FilesystemUnmount will only take an
ObjectPath that udisks handed out. So by adding a check for that and then
looking it up I got it to work. See the code below.

    
    
    import dbus
    
    path = '/dev/fd0'
    
    bus = dbus.SystemBus()
    
    if not isinstance(path, dbus.ObjectPath):
        manager_obj = bus.get_object('org.freedesktop.UDisks',
                                     '/org/freedesktop/UDisks')
        manager = dbus.Interface(manager_obj, 'org.freedesktop.UDisks')
        path = manager.FindDeviceByDeviceFile(path)
    
    proxy = bus.get_object('org.freedesktop.UDisks', path)
    dev = dbus.Interface(proxy, 'org.freedesktop.UDisks.Device')
    dev.FilesystemUnmount('')
    

