Comment 3 for bug 1006633

Revision history for this message
Brian Murray (brian-murray) wrote :

While writing the test case for the SRU of this bug I discovered an error in the regular expression I wrote.

+ # for packages that run update-grub include /etc/default/grub
+ UPDATE_BOOT = ['memtest86+', 'linux', 'ubuntu-meta',
+ 'virtualbox-ose']
+ ug_failure = 'User post(inst|rm) hook script \[(/usr)?/sbin/update-grub\] exited with value [1-9]+'
+ if re.search(ug_failure, termlog):
+ if report['SourcePackage'] in UPDATE_BOOT:
+ attach_default_grub(report, 'EtcDefaultGrub')

The ug_failure regular expression was created by looking at package installation failure log files, DpkgTerminalLog, for the grub2 package. It seems that error message from grub2 is different than that of the one from any of the packages in UPDATE_BOOT. Instead for a memtest86+ failure we'll have the following:

/etc/default/grub: 9: splash: not found^M
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127^M
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.38-13-generic.postinst line 1010.^M
dpkg: error processing linux-image-2.6.38-13-generic (--configure):^M
 subprocess installed post-installation script returned error exit status 2^M
Setting up memtest86+ (4.10-1.1ubuntu1) ...^M

So the ug_failure regular expression needs to be reworked to actually match the errors created by the packages in UPDATE_BOOT.