Bug Reporting Tool

Robert Olson olson at mcs.anl.gov
Mon Jun 16 13:04:50 CDT 2003


At 12:44 PM 6/16/2003 -0500, Susanne Lefvert wrote:
>Use smtplib and email.MIMEText from python standard lib to send message

You need to be careful there; it's not clear that you can always send mail 
from a windows box (or from an arbitrary linux box either; however, linux 
often has a sendmail running locally); smtplib needs to know a valid smtp 
server, which you can't necessarily figure out (would need to work out what 
apps on that machine currently know how to send mail, and determine from 
their configs what the right smtp server is; even then, mail may not be 
configured on that machine).

At the end is the script I put together awhile ago that will use the 
bugzilla forms interface to submit a bug. Consider it an example of how to 
do this.

--bob

import sys
import urllib

url = "http://bugzilla.mcs.anl.gov/accessgrid/post_bug.cgi"
args = {}

bugzilla_login = 'client-ui-bugzilla-user at mcs.anl.gov'
bugzilla_password = '8977f68349f93fead279e5d4cdf9c3a3'

args['Bugzilla_login'] = bugzilla_login
args['Bugzilla_password'] = bugzilla_password
args['product'] = "Virtual Venues Client Software"
args['version'] = "2.0"
args['component'] = "Client UI"
args['rep_platform'] = "Other"

#
# This detection can get beefed up a lot; I say
# NT because I can't tell if it's 2000 or XP and better
# to not assume there.
#
# cf http://www.lemburg.com/files/python/platform.py
#

if sys.platform.startswith("linux"):
     args['op_sys'] = "Linux"
elif sys.platform == "win32":
     args['op_sys'] = "Windows NT"
else:
     args['op_sys'] = "other"

args['priority'] = "P2"
args['bug_severity'] = "normal"
args['bug_status'] = "NEW"
args['assigned_to'] = ""
args['cc'] = "olson at mcs.anl.gov"   # email to be cc'd
args['bug_file_loc'] = "http://"


args['submit'] = "    Commit    "
args['form_name'] = "enter_bug"

# Bug information goes here
args['short_desc'] = "Crash in Client UI"
args['comment']="Here goes the backtrace"

#
# Now submit to the form.
#

params = urllib.urlencode(args)

f = urllib.urlopen(url, params)

#
# And read the output.
#

out = f.read()
f.close()

print "Submit returns ", out

o = open("out.html", "w")
o.write(out)
o.close()





More information about the ag-dev mailing list