Author: gnichols
Date: 2012-05-29 17:03:48 +0000 (Tue, 29 May 2012)
New Revision: 1333
Modified:
trunk/v7/hardwaretest.py
Log:
822690 - v7 fails to generate results package (rpm) if vendor field is not set.\n 824306 -
Fail to open a new cert if 'Make' and/or 'Model' fields empty
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2012-05-29 17:02:54 UTC (rev 1332)
+++ trunk/v7/hardwaretest.py 2012-05-29 17:03:48 UTC (rev 1333)
@@ -1014,6 +1014,12 @@
self.removeLogFiles()
return True
+ # make sure model and vendor are set
+ if not (self.certification.getHardware(Tags.vendor) and
self.certification.getHardware(Tags.make) and
self.certification.getHardware(Tags.model)):
+ print "Error: could not generate results rpm because vendor, make or
model are not set"
+ print "Use \"v7 plan --certification to set these values"
+ return False
+
if self.options.mode == Constants.auto or self.ui.promptConfirm("Would
you like to package the results?"):
report = Report(self.options, self.certification)
if report.WriteResultsRPM(self.environment.getLogDirectory()):
@@ -1127,10 +1133,24 @@
elif os.path.exists('/proc/device-tree/model'):
f=open('/proc/device-tree/model')
model = f.readline().strip()
+ # if there's a comma, guess the format is <vendor>, <model>
+ try:
+ if ',' in model:
+ vendor = model.split(',')[0]
+ model = model.split(',')[1]
+ except:
+ pass
+
f.close()
- elif arch in ['s390','s390x']:
- vendor = 'IBM'
- make = 'eServer zSeries'
+ # IBM-likely arches
+ if arch in ['s390','s390x', "ppc", "ppc64"]:
+ if not vendor:
+ vendor = 'IBM'
+ if not make:
+ make = 'IBM'
+ if not model:
+ model = arch
+
self.certification.setHardware(Tags.model, model)
Show replies by date