Relabeling of a device doesn't work

Bug #414018 reported by Fabian Affolter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
USBManager
Fix Released
Critical
Magnun Leno

Bug Description

I'm trying to pass a new label to the device but it ends with a DBus error.

org.freedesktop.Hal.Device.Volume.UnknownFailure: Cannot open /media/.hal-mtab

I guess that the problem is around ' * Attention: Going sudo!'

[fab@laptop09 noarch]$ usbmanager
Starting DBus...
Starting HAL...
Connecting to signals...
Building devices list...
 * New device: FEDORA (/dev/sdb1)
Running Main Window (mode 1)
/usr/lib/python2.6/site-packages/usbmanager/gui/messages.py:62: GtkWarning: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed
  dialog.run()
 * Umounting FEDORA... Erro!
 * Preparing to rename from FEDORA to test ...
 * Attention: Going sudo!
 ** /usr/bin/mlabel -i /dev/sdb1 ::test
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/usbmanager/gui/widgets.py", line 289, in __on_properties_click
    self.master.create_properties_window(device)
  File "/usr/lib/python2.6/site-packages/usbmanager/main.py", line 181, in create_properties_window
    if self.change_device_label(device, new_label):
  File "/usr/lib/python2.6/site-packages/usbmanager/main.py", line 156, in change_device_label
    gui.messages.ErrorDuringRename(device, error)
  File "/usr/lib/python2.6/site-packages/usbmanager/gui/messages.py", line 88, in ErrorDuringRename
    ShowMessage(None, _("Erro while renaming %(block_device)s!")%{"block_device":device.block_device}, _("The following error ocurred!")+"\n\n"+error+"\n\n"+_("Please contact the developer."),0)
TypeError: cannot concatenate 'str' and 'NoneType' objects

Related branches

Revision history for this message
Fabian Affolter (fab-fedoraproject) wrote :

Sorry for the noise, it fooled me. Formatting shows the issue.

 * Umounting FEDORA... Erro!
 * Formating: gksudo "mkfs.vfat /dev/sdb1 -F 32 -v -n test"

Unfortunately gksu is available for Fedora. So this is seams to be only a Fedora issue.

Revision history for this message
Magnun Leno (magnun-leno) wrote :

Hum... There is something more, it couldn't umount your device. When you try ony to mount/umount the devices, is there some error??

About the gksu, I'll take a look on it. Since it is present in ubuntu and debian maybe I'll change all the gksudo ocurrences.

Changed in usbmanager:
assignee: nobody → Magnun Leno (magnun-leno)
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Magnun Leno (magnun-leno) wrote :

I've added a verification in the label changing process. It will show the mounting error, can you test it? Is at the trunk:

$ bzr branch lp:usbmanager

Thanks...

Revision history for this message
Fabian Affolter (fab-fedoraproject) wrote :

PolicyKit could be an option. It has a python interface and is present on all major distributions.

Revision history for this message
Magnun Leno (magnun-leno) wrote :

I've changed the code. Now it's using gksu, here in ubuntu and debian it's fine.

I'am trying to learn about PolicyKit. Ass soon as I get how it works I'll change for it. Thanks for the suggestion!

Revision history for this message
Magnun Leno (magnun-leno) wrote :

I've made some changes and added a routine that determines which sudo graphical frontend can be used.

Currently it supports gksu, gksudo (both for debian and derived distributions) and beezu (for RedHat and derived distributions).

Thanks for helping me discover this bug.

Changed in usbmanager:
status: Confirmed → Fix Committed
Revision history for this message
Fabian Affolter (fab-fedoraproject) wrote :

Are you planning to make a new release? Perhaps 1.0.1?

Please leave 'rc', 'alpha', and other alphabetical stuff out of the versioning schema, this makes it much easier for packagers. Less manual changes in the spec files.

Revision history for this message
Magnun Leno (magnun-leno) wrote :

Sure, I'm just waiting to ensure this bug is solved and the translations to finish.
I was planning to release it as 1.0-stable, but after reading this I'll surely release it as 1.0.1.

Thanks for the help again!

Changed in usbmanager:
milestone: none → 1.0
Changed in usbmanager:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.