#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
#
# Check on RTI status for bug IDs passed.
#
# How we obtain the bug IDs will vary per SCM.
# - For Teamware, we want to check the active list comments.
# - For Mercurial, we can check the incoming changegroup (via the
# pretxnchangegroup hook) and abort if necessary
#
# This module is implemented as a generic checking module given a list of
# bug IDs. It can then be wrapped or hooked into whatever SCM with an
# SCM-specific hook to parse and pass the requisite bug IDs
#
"""Return True iff each of the specified bugids has an approved RTI.
Required argument:
bugids: list of seven-digit bug ids
Keyword arguments, used to limit the scope of the RTI search:
gatePath: fully qualified path to gate
consolidation: name of the consolidation
"""
rtiType = "MarketingRelease"
gateType = "MarketingRelease"
# Check to see if we were given a gate to lookup with
if gatePath != None:
#
# The gate name should be the last component of the gate path,
# no matter how it's accessed.
#
# We make a special case for both "closed" and "man", checking
# to see if it appears to be the "usr/[closed,|man]" portion of
# a nested repository. In that case, we really want the parent
# repository name.
#
try:
except IndexError:
pass
# Is this an OpenSolaris gate?
rtiType = "OpenSolaris"
gateType = "OpenSolaris"
# Is this a patch gate?
rtiType = "Patch"
gateType = "Patch"
# Is this an OSE (OpenSolarisExpress) gate?
rtiType = "OSE-11"
gateType = "OSE-11"
# Is this an S11 update gate?
rtiType = "SolarisUpdate"
gateType = "SolarisUpdate"
rtiType = "SolarisUpdate"
gateType = "SolarisUpdate"
# Is this an S11 SRU gate?
rtiType = "SolarisUpdate"
gateType = "SolarisUpdate"
# Is this a test gate?
rtiType = "RTI"
gateType = "RTI"
else:
gateName = None
# Query RTI if there's a gate
# Check the RTIs, caching them in the 'rtis' dictionary
rtis = {}
badRtis = []
# If we don't already have an Rti object for this cr cached,
try:
except RtiOffSwan, e:
return False
except RtiException, e:
continue
# If we've reached this point, then the Rti query succeeded,
# and we didn't get an error back from webrti. There is still
# some sanity checking to be done, however
# check to make sure the RTI type matches the gate type
continue
message += "the accepted state.\n"
continue
return False
return True