Greig A. Cowan wrote:
> What's your hack? I thought the code in there would deal with that
> situation.
For any of the dpm-sql-* programs I get the following error:
[root@gridstore ~]# python dpm-sql-spacetoken-list-files
Traceback (most recent call last):
File "dpm-sql-spacetoken-list-files", line 56, in ?
main()
File "dpm-sql-spacetoken-list-files", line 36, in main
(h,d) = hd.split('/')
ValueError: unpack list of wrong size
The following patch fixes it (probably could be done more elegantly):
--- dpm-sql-spacetoken-list-files.orig 2009-01-29 08:54:37.000000000 +0000
+++ dpm-sql-spacetoken-list-files 2009-01-29 09:00:02.000000000 +0000
@@ -33,9 +33,14 @@
dpminfo = file(dpminfopath)
(up,hd) = dpminfo.readline().split('@')
(u,p) = up.split('/')
- (h,d) = hd.split('/')
- if (d==None):
- d='cns_db'
+
+ hdlist = hd.split('/')
+ if (len(hdlist) == 1):
+ h=hdlist[0]
+ d='cns_db'
+ else:
+ (h,d)=hdlist
+
try:
c = MySQLdb.connect(host=h, user=u, passwd=p, db=d.strip())
--
Dr. Stephen Childs,
Research Fellow, EGEE Project, phone: +353-1-8961797
Computer Architecture Group, email: Stephen.Childs @ cs.tcd.ie
Trinity College Dublin, Ireland web: http://www.cs.tcd.ie/Stephen.Childs
|