def get_status_from_summary_file(pkg, node_id, stage): file = "%s.%s-summary.dcf" % (pkg, stage) rdir = BBScorevars.nodes_rdir.subdir('%s/%s' % (node_id, stage)) try: status = BBSreportutils.WReadDcfVal(rdir, file, 'Status') except bbs.rdir.WOpenError: if stage == "install": return "NotNeeded" return "NA" return status
def get_status_from_summary_file(pkg, node_id, stagecmd): file = "%s.%s-summary.dcf" % (pkg, stagecmd) rdir = BBScorevars.nodes_rdir.subdir('%s/%s' % (node_id, stagecmd)) try: status = BBSreportutils.WReadDcfVal(rdir, file, 'Status') except urllib2.HTTPError: if stagecmd == "install": return "NotNeeded" print "==> FATAL ERROR: cannot get %s status for package %s on %s" % (stagecmd, pkg, node_id) sys.exit("==> EXIT") return status