Commit 3b339d96 authored by Paul Rich's avatar Paul Rich
Browse files

Fixing spacing in cdbwriter.py

parent 76c466ca
......@@ -2,7 +2,6 @@
components to a target database.
"""
__revision__ = '$Revision: 1 $'
import os
import sys
......@@ -17,12 +16,14 @@ except ImportError:
import db2util
import Cobalt.Logging, Cobalt.Util
import Cobalt.Logging
import Cobalt.Util
from Cobalt.Statistics import Statistics
from Cobalt.Components.DBWriter.cdbMessages import LogMessage, LogMessageDecoder, LogMessageEncoder
from Cobalt.Components.base import Component, exposed, automatic, query, locking
from Cobalt.Proxy import ComponentProxy
__revision__ = '$Revision: 1 $'
logger = logging.getLogger("Cobalt.Components.cdbwriter")
config = ConfigParser.ConfigParser()
......@@ -158,11 +159,11 @@ class MessageQueue(Component):
try:
self.database_writer.addMessage(msg)
except db2util.adapterError:
logger.error ("Error updating databse. Unable to add message due to adapter error. Message dropped.")
logger.error("Error updating databse. Unable to add message due to adapter error. Message dropped.")
logging.debug(traceback.format_exc())
self.msg_queue.pop(0)
except:
logger.error ("Error updating databse. Unable to add message. %s", msg)
logger.error("Error updating databse. Unable to add message. %s", msg)
logging.debug(traceback.format_exc())
self.connected = False
#if we were clearing an overflow, here we go again.
......@@ -236,7 +237,6 @@ class MessageQueue(Component):
def del_overflow(self):
os.remove(self.overflow_filename)
def queue_to_overflow(self):
elements_written = 0
......@@ -270,7 +270,6 @@ def decodeLogMsg(msgStr):
class DatabaseWriter(object):
def __init__(self, dbName, username, password, schema):
self.db = db2util.db()
try:
......@@ -327,7 +326,6 @@ class DatabaseWriter(object):
self.db.prepExec("set current schema %s" % schema)
def addMessage(self, logMsg):
logger.debug("Inserting Data message of type: %s.%s " % (logMsg.item_type, logMsg.state))
#print logMsg
......@@ -865,7 +863,7 @@ class JobDepsData(db2util.dao):
class no_pk_dao(db2util.dao):
def insert (self, record):
def insert(self, record):
"""Inserts the passed record and returns the IDENTITY value
if applicable"""
......@@ -887,12 +885,12 @@ class no_pk_dao(db2util.dao):
def update (self, record):
def updat (self, record):
"""Updates of a primary-keyless record aren't supported."""
raise AssertionError("update operations are not supported on "\
"tables without primary keys.")
def delete (self, record):
def delet (self, record):
"""Delete not supported on primary-keyless tables via db2util."""
raise AssertionError("delete operations are not supported on "\
"tables without primary keys.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment