[DB-SIG] Python-db select

Nasr Y.M.J.O. nasr974 at hotmail.com
Wed Sep 6 23:16:57 CEST 2006


Dear All,

Im new to this list. Im trying to run a python script (Linux 2.6.9) in order 
to configure a cluster filesystem. When I ran the script I had the following 
error:

-------------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/rocks-lustre/bin/rocksfs-config-lustre.py", line 318, in ?
    main()
  File "/opt/rocks-lustre/bin/rocksfs-config-lustre.py", line 315, in main
    app.run()
  File "/opt/rocks-lustre/bin/rocksfs-config-lustre.py", line 306, in run
    self.config_lustre()
  File "/opt/rocks-lustre/bin/rocksfs-config-lustre.py", line 229, in 
config_lustre
    osslist = self.get_OSS()
  File "/opt/rocks-lustre/bin/rocksfs-config-lustre.py", line 99, in get_OSS
    query = 'select nodes.id, nodes.name from nodes where '\
TypeError: int argument required
----------------------------------------------------------------------------------------------------------------------------------------

Here are the lines:

def get_OSS(self):
		#grabs the OSS servers from the database
line 99 -------->	query = 'select nodes.id, nodes.name from nodes where '\
			'nodes.membership=%d ' \
			'or nodes.membership=%d' \
			% (self.memberships['Compute-oss'],
			self.memberships['Lustre-oss'])

		osslist = []
		rc = self.rocksdb.execute(query)
		if rc:
			for row in self.rocksdb.fetchall():
				nodeid = int(row[0])
				nodename = row[1]
				osslist.append((nodeid,nodename))
		return osslist

----------------------------------------------------------------------------------------------------------------------------------------

Im using MYSQL 4.1.12.3 and Python 2.3.4. Any suggestions of how to solve 
this is greatly appreciated.

Many thanks,

-nasr

_________________________________________________________________
Get an advanced look at the new version of MSN Messenger. 
http://messenger.msn.com.my/Beta/Default.aspx



More information about the DB-SIG mailing list