Author: gnichols
Date: 2012-04-20 13:27:43 +0000 (Fri, 20 Apr 2012)
New Revision: 1290
Modified:
trunk/v7/certificationtest.py
trunk/v7/hardwaretest.py
Log:
809240 - v7 plan --model should use the same prompts as v7 plan for certification data
Modified: trunk/v7/certificationtest.py
===================================================================
--- trunk/v7/certificationtest.py 2012-04-20 13:25:08 UTC (rev 1289)
+++ trunk/v7/certificationtest.py 2012-04-20 13:27:43 UTC (rev 1290)
@@ -57,18 +57,12 @@
hardwareElement = self.findOrCreateElement(self.document.documentElement, Tags.hardware)
element = self.findOrCreateElement(hardwareElement, tag)
textNode = self.getTextNode(element)
- # YK: return "unknown" if can not find such hardware info
- if textNode:
- if textNode.data:
- if textNode.data.isspace():
- return "unknown"
- else:
- return textNode.data
- else:
- return "unknown"
- else:
- return "unknown"
+ if textNode and not textNode.data.isspace():
+ return textNode.data
+ # otherwise
+ return ""
+
def setOS(self, tag, value):
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2012-04-20 13:25:08 UTC (rev 1289)
+++ trunk/v7/hardwaretest.py 2012-04-20 13:27:43 UTC (rev 1290)
@@ -246,7 +246,7 @@
self.certification.getHardware(Tags.model))
self.getOSInfo()
if self.options.mode != Constants.auto:
- self.catalog.getCertificationID(self.certification)
+ self.editCertification()
# save the certification info off to certification.xml
certificationDocument = CertificationDocument()
@@ -1124,25 +1124,11 @@
elif arch in ['s390','s390x']:
vendor = 'IBM'
make = 'eServer zSeries'
-
- # try asking the humans for it
- if self.options.mode == Constants.normal:
- print "Please verify the vendor, make, and model:"
- vendor = self.ui.promptEdit("Vendor: ", vendor)
- if vendor:
- self.certification.setHardware(Tags.vendor, vendor)
- make = self.ui.promptEdit("Make: ", make)
- if make:
- self.certification.setHardware(Tags.make, make)
- model = self.ui.promptEdit("Model: ", model)
- if model:
- self.certification.setHardware(Tags.model, model)
-
- else: # --mode auto
- self.certification.setHardware(Tags.model, model)
- self.certification.setHardware(Tags.make, make)
- self.certification.setHardware(Tags.vendor, vendor)
+
+ self.certification.setHardware(Tags.model, model)
+ self.certification.setHardware(Tags.make, make)
+ self.certification.setHardware(Tags.vendor, vendor)
def getArch(self):
@@ -1408,21 +1394,25 @@
certificationID = self.certification.getCertificationID()
- answers = None
- if certificationID:
+
+ # if the certification id isn't set yet - see if they want to use the catalog
+ if not certificationID:
+ self.catalog.getCertificationID(self.certification)
+ # else, let them edit it directly
+ else:
answers = list()
answers.append(str(certificationID))
- while True:
- value = self.ui.prompt("\nPlease enter the certification ID:", answers)
- if not value:
- break
- try:
- int(value)
- break
- except ValueError:
- print "Error: %s is not an integer." % value
- if value and int(value) >= 0:
- self.certification.setCertificationID(value)
+ while True:
+ value = self.ui.prompt("\nPlease enter the certification ID:", answers)
+ if not value:
+ break
+ try:
+ int(value)
+ break
+ except ValueError:
+ print "Error: %s is not an integer." % value
+ if value and int(value) >= 0:
+ self.certification.setCertificationID(value)
# copy over to certification.xml