Univention Bugzilla – Bug 25826
Traceback in uvmm_restory.py, wenn neuer Symlink auf README schon vorhanden
Last modified: 2012-12-12 21:09:46 CET
Folgender Traceback wurde über Ticket 2012011121005803 nach einem ucr commit gemeldet: [...] File: /etc/libvirt/libvirtd.conf File: /etc/default/libvirt-bin Module: uvmm_restore Traceback (most recent call last): File "/usr/sbin/ucr", line 42, in ? ub.main(sys.argv[1:]) File "/usr/lib/python2.4/site-packages/univention/config_registry.py", line 1471, in main handlers[ action ][ 0 ]( args, cmd_opts ) File "/usr/lib/python2.4/site-packages/univention/config_registry.py", line 964, in handler_commit c.commit(b, args) File "/usr/lib/python2.4/site-packages/univention/config_registry.py", line 829, in commit object((bc, d)) File "/usr/lib/python2.4/site-packages/univention/config_registry.py", line 546, in __call__ runModule(self.module, 'generate', bc, changed) File "/usr/lib/python2.4/site-packages/univention/config_registry.py", line 403, in runModule arg2meth[arg](module)(bc, changes) File "/etc/univention/templates/modules/uvmm_restore.py", line 48, in handler os.symlink( '/usr/share/doc/univention-virtual-machine-manager-node-common/README.restore', new_symlink ) OSError: [Errno 17] File exists
ucs-3.0/ucs/virtualization/univention-virtual-machine-manager-node/conffiles/uvmm_restore.py:47 > if new and os.path.isdir( new ) and not os.path.exists( new_symlink ): > os.symlink( '/usr/share/doc/univention-virtual-machine-manager-node-common/README.restore', new_symlink ) os.path.exists() folgt hier dem (kaputten?) Symlink und meldet folgerichtig False zurück. Da Anschließende os.symlink() probiert dann den Link erneut anzulegen, was dann fehlschlägt. diff --git a/branches/ucs-3.0/ucs/virtualization/univention-virtual-machine-manager-node/conffiles/uvmm_restore.py b/branches/ucs-3.0/ucs/virtualization/univention-virtual-machine-manager-node/conffiles/uvmm_restore.py index 347ec7b..bd8bbe1 100644 --- a/branches/ucs-3.0/ucs/virtualization/univention-virtual-machine-manager-node/conffiles/uvmm_restore.py +++ b/branches/ucs-3.0/ucs/virtualization/univention-virtual-machine-manager-node/conffiles/uvmm_restore.py @@ -32,6 +32,9 @@ # <http://www.gnu.org/licenses/>. import os +import errno + +README = '/usr/share/doc/univention-virtual-machine-manager-node-common/README.restore' def handler( ucr, changes ): try: @@ -44,5 +47,9 @@ def handler( ucr, changes ): if os.path.exists( old_symlink ): os.unlink( old_symlink ) new_symlink = os.path.join( new, 'README.restore' ) - if new and os.path.isdir( new ) and not os.path.exists( new_symlink ): - os.symlink( '/usr/share/doc/univention-virtual-machine-manager-node-common/README.restore', new_symlink ) + if new and os.path.isdir( new ) and not os.path.exists( new_symlink ) and os.path.exists(README): + try: + os.symlink(README, new_symlink) + except OSError, e: + if e.errno != errno.EEXIST: + raise
Der Patch ist bereits mit svn30945 seit Februar 2012 im Rahmen der RTC-Umbauten eingespielt.
Kein Traceback wenn die Datei /usr/share/doc/univention-virtual-machine-manager fehlt.
UCS 3.1-0 has been released: http://forum.univention.de/viewtopic.php?f=54&t=2125 If this error occurs again, please use "Clone This Bug".