koji api "createEmptyBuild" arguments problems:
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1 1.3 "" Fault: <Fault 1: "<class 'pg.DatabaseError'>: error 'ERROR: operator does not exist: text = integer\nLINE 2: WHERE pkg_id=9168 AND version=1 AND release='1.3'\n ^\nHINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.\n' in 'SELECT id,state,task_id FROM build\n WHERE pkg_id=9168 AND version=1 AND release='1.3'\n FOR UPDATE'">
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1.1 1.3 "" Fault: <Fault 1: '<class 'pg.DatabaseError'>: error 'ERROR: invalid input syntax for integer: ""\nLINE 4: VALUES (18338,9169,'1.1','1.3','',\n ^\n' in '\n INSERT INTO build (id,pkg_id,version,release,epoch,state,\n task_id,owner,completion_time)\n VALUES (18338,9169,'1.1','1.3','',\n 1,NULL,1,'NOW')\n ''>
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1.1 1.3 2 18339
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1.1 1.3 Fault: <Fault 1: "<type 'exceptions.TypeError'>: createEmptyBuild() takes at least 5 arguments (4 given)">
if version is a number , not string , how to do it ? what is epoch argument ? Default is NULL. How to give a NULL value ?
koji-hub-1.3.2-1.fc13.noarch
Thanks
On 04/02/2011 01:55 AM, Eric Zhong wrote:
if version is a number , not string , how to do it ? what is epoch argument ? Default is NULL. How to give a NULL value ?
Epoch values must be integer or null. When using the call command, you can specify a python None value (which maps to null in the db) by name.
E.g. # koji call createEmptyBuild nvidia 1 1.3 None
Version be treated as a integer!!! How to give a integer to koji as string ??? Is it a bug of koji ??? Thanks.
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1 1.3 None Fault: <Fault 1: "<class 'pg.DatabaseError'>: error 'ERROR: operator does not exist: text = integer\nLINE 2: WHERE pkg_id=9170 AND version=1 AND release='1.3'\n ^\nHINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.\n' in 'SELECT id,state,task_id FROM build\n WHERE pkg_id=9170 AND version=1 AND release='1.3'\n FOR UPDATE'">
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1.0 1.3 None 18340
2011/4/4 Mike McLean mikem@redhat.com
On 04/02/2011 01:55 AM, Eric Zhong wrote:
if version is a number , not string , how to do it ? what is epoch argument ? Default is NULL. How to give a NULL value ?
Epoch values must be integer or null. When using the call command, you can specify a python None value (which maps to null in the db) by name.
E.g. # koji call createEmptyBuild nvidia 1 1.3 None
-- buildsys mailing list buildsys@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/buildsys
On 04/05/2011 10:12 PM, Eric Zhong wrote:
Version be treated as a integer!!! How to give a integer to koji as string ??? Is it a bug of koji ??? Thanks.
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1 1.3 None Fault:<Fault 1: "<class 'pg.DatabaseError'>: error 'ERROR: operator does not exist: text = integer\nLINE 2: WHERE pkg_id=9170 AND version=1 AND release='1.3'\n ^\nHINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.\n' in 'SELECT id,state,task_id FROM build\n WHERE pkg_id=9170 AND version=1 AND release='1.3'\n FOR UPDATE'">
[zhongwenjia@build ~]$ koji call createEmptyBuild nvidia 1.0 1.3 None 18340
The call command in the cli isn't perfect. It's really more of a debugging tool. Unfortunately there's no way for it to know whether you mean the string "1" or the integer 1. If you're running a sufficiently new python, you can use the --python option to have the arguments interpreted as python expressions. E.g.
# koji call --python createEmptyBuild '"nvidia"' '"1"' '"1.3"' None
Otherwise you'll need to make the xmlrpc call more directly. Something like: # python
import koji session = koji.ClientSession('SERVER_URL') # if using krb auth, use the following: session.krb_login() # otherwise use one of the other login methods defined in ClientSession session.createEmptyBuild('nvidia', '1', '1.3', None)
buildsys@lists.fedoraproject.org