If we try to get_console_output for an instance in an lxc container, the following error is thrown:
2011-09-18 19:42:41,295 INFO nova.virt.libvirt_conn [-] Unable to read LXC console
2011-09-18 19:42:41,295 ERROR nova.exception [-] Uncaught exception
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/home/rohit/nova/diablo/libvirt_unittests/nova/exception.py", line 98, in wrapped
(nova.exception): TRACE: return f(*args, **kw)
(nova.exception): TRACE: File "/home/rohit/nova/diablo/libvirt_unittests/nova/virt/libvirt/connection.py", line 670, in get_console_output
(nova.exception): TRACE: return self._dump_file(fpath)
(nova.exception): TRACE: UnboundLocalError: local variable 'fpath' referenced before assignment
Along with the info message, the 'fpath' variable setting for this case should be handled in the code.
I created a patch to fix the console output, see attached file.