1N/A# The contents of this file are subject to the terms of the 1N/A# Common Development and Distribution License (the "License"). 1N/A# You may not use this file except in compliance with the License. 1N/A# See the License for the specific language governing permissions 1N/A# and limitations under the License. 1N/A# When distributing Covered Code, include this CDDL HEADER in each 1N/A# If applicable, add the following below this CDDL HEADER, with the 1N/A# fields enclosed by brackets "[]" replaced with your own identifying 1N/A# information: Portions Copyright [yyyy] [name of copyright owner] 1N/A# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 1N/A# * bugs.opensolaris.org (b.o.o.) 1N/A """Lookup change requests. 1N/A Object can be used on or off of SWAN, using either monaco or 1N/A bugs.opensolaris.org as a database. 1N/A r = bdb.lookup("6455550") 1N/A print r["6455550"]["synopsis"] 1N/A r = bdb.lookup(["6455550", "6505625"]) 1N/A print r["6505625"]["synopsis"] 1N/A """Create a BugDB object. 1N/A forceBoo: use b.o.o even from SWAN (default=False) 1N/A priority: use bug databases in this order 1N/A print "ERROR: HTTP error at " + \
1N/A print "ERROR: could not connect to " + \
1N/A """Return all info for requested change reports. 1N/A crs: list of change request ids 1N/A Dictionary, mapping CR=>dictionary, where the nested dictionary 1N/A is a mapping of field=>value 1N/A # See if 'maxcrs' for maximal batch query size is defined 1N/A # if not, default to 200. 1N/A # This clears the 2499 chars query limit 1N/A # We request synopsis last, and split on only 1N/A # the number of separators that we expect to 1N/A # see such that a | in the synopsis doesn't 1N/A # throw us out of whack. 1N/A "area",
"release",
"build",
"responsible_manager",
1N/A "responsible_engineer",
"priority",
"status",
"sub_status",
1N/A "submitted_by",
"date_submitted",
"synopsis" ]
1N/A url +=
"Pipe-delimited+text;Go=2;no_header=on;cmds=" 1N/A print "ERROR: HTTP error at " +
url + \
1N/A print "ERROR: could not connect to " +
url + \
1N/A """Return all info for requested change reports. 1N/A crs: one change request id (may be integer, string, or list), 1N/A or multiple change request ids (must be a list) 1N/A Dictionary, mapping CR=>dictionary, where the nested dictionary 1N/A is a mapping of field=>value 1N/A # else we're off-swan and querying via boo, which we can 1N/A # only do one bug at a time 1N/A # the CR has already been found by one bug database 1N/A # so don't bother looking it up in the others 1N/A#################################################################### 1N/A """This covers arc.cgi script failure.""" 1N/A fields = [
"present",
"arc",
"year",
"case",
"status",
"title"]
1N/A#################################################################### 1N/A# Pointers to the webrti server hostname & port to use 1N/A# Using it directly is probably not *officially* supported, so we'll 1N/A# have a pointer to the official `webrticli` command line interface 1N/A# if using a direct socket connection fails for some reason, so we 1N/A# Our Rti object which we'll use to represent an Rti query 1N/A# It's really just a wrapper around the Rti connection, and attempts 1N/A# to establish a direct socket connection and query the webrti server 1N/A# falls back to the webrticli command line client. 1N/A print r.rtiNumber(); 1N/A """Create an Rti object for the specified change request. 1N/A cr: change request id 1N/A Keyword arguments, to limit scope of RTI search: 1N/A gate: path to gate workspace (default=None) 1N/A consolidation: consolidation name (default=None) 1N/A # If the passed 'cr' was given as an int, then wrap it 1N/A # into a string to make our life easier 1N/A # try to use a direct connection to the 1N/A # webrti server first 1N/A # keep receiving data from the socket until the 1N/A # server closes the connection 1N/A # create the lines, skipping the first 1N/A # ("WEBRTCLI/1.0\n") 1N/A # fallback to the "supported" webrticli interface 1N/A # we couldn't call the webrticli for some 1N/A # reason, so return a failure 1N/A # parse the data to see if we got a return code 1N/A # if we did, then that's bad. if we didn't, 1N/A # then our call was successful 1N/A # we got a return code, set it in our 1N/A # object, set the webRtiOutput for debugging 1N/A # or logging, and return a failure 1N/A # At this point, we should have valid data 1N/A # accessors in case callers need the raw data 1N/A # in practice, most callers only care about the following