backend/satellite_tools/spacewalk-report | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit fd2ec1b9a93b76b8e2720844178f38a80b9c6b23 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 11:25:05 2009 +0200
reporting: initial prepare, execute, and fetch loop.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index ca7b63d..2a2550a 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -66,6 +66,18 @@ if __name__ == '__main__': try: initCFG('server') rhnSQL.initDB(options.db) + + h = rhnSQL.prepare(""" + select rhnserver.id as server_id, rhnserver.name as profile_name + from rhnserver + order by server_id + """) + h.execute() + row = h.fetchone() + while row != None: + print row + row = h.fetchone() + except KeyboardInterrupt: systemExit(-1, "\nUser interrupted process.") except (rhnSQL.SQLError, rhnSQL.SQLSchemaError, rhnSQL.SQLConnectError), e:
spacewalk-commits@lists.fedorahosted.org