Comment 5 for bug 882882

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I have a kind-of unit-test reproducer. What happens is that debconf database is locked and status ends up as empty string.

test_empty (test_ubi_partman.TestCalculateAutopartitioningOptions) ... debconf: DbDriver "configdb": /home/tdlk/canonical/installer/adv-crypto/tests/config.dat is locked by another process: Resource temporarily unavailable
ERROR

Which results in:

======================================================================
ERROR: test_question_dialog (test_gtkui.TestFrontend)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tdlk/canonical/installer/adv-crypto/tests/test_gtkui.py", line 46, in test_question_dialog
    ui = gtk_ui.Wizard('test-ubiquity')
  File "./ubiquity/frontend/gtk_ui.py", line 208, in __init__
    BaseFrontend.__init__(self, distro)
  File "./ubiquity/frontend/base.py", line 113, in __init__
    self.start_debconf()
  File "./ubiquity/frontend/base.py", line 330, in start_debconf
    self.db = self.debconf_communicator()
  File "./ubiquity/frontend/base.py", line 325, in debconf_communicator
    return DebconfCommunicator('ubiquity', cloexec=True)
  File "./ubiquity/debconfcommunicator.py", line 37, in __init__
    write=self.dccomm.stdin)
  File "/usr/lib/python3/dist-packages/debconf.py", line 50, in __init__
    self.setUp(title)
  File "/usr/lib/python3/dist-packages/debconf.py", line 53, in setUp
    self.version = self.version(2)
  File "/usr/lib/python3/dist-packages/debconf.py", line 62, in <lambda>
    lambda *args, **kw: self.command(command, *args, **kw))
  File "/usr/lib/python3/dist-packages/debconf.py", line 83, in command
    status = int(status)
ValueError: invalid literal for int() with base 10: ''

My guess is that debconf shouldn't trust 'status' to be a valid value castable to an int, instead it possibly should check if it's empty and raise appropriate error.