Skip to content

Commit

Permalink
proposed fix for mysql plugin: migrate type LargeBinary to Text
Browse files Browse the repository at this point in the history
  • Loading branch information
savon-noir committed Jun 18, 2014
1 parent b355242 commit 7c61ee6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libnmap/plugins/sql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from sqlalchemy import create_engine
from sqlalchemy.schema import Column
from sqlalchemy.types import Integer, DateTime, LargeBinary
from sqlalchemy.types import Integer, DateTime, LargeBinary, Text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

Expand Down Expand Up @@ -53,7 +53,7 @@ class Reports(Base):

id = Column('report_id', Integer, primary_key=True)
inserted = Column('inserted', DateTime(), default='now')
report_json = Column('report_json', LargeBinary)
report_json = Column('report_json', Text(convert_unicode=True))

def __init__(self, obj_NmapReport):
self.inserted = datetime.fromtimestamp(obj_NmapReport.endtime)
Expand Down
1 change: 1 addition & 0 deletions libnmap/test/test_backend_plugin_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def test_backend_get(self):
result_list.append(backend.get(rep_id))
#print result_list[0]
#print self.reportList[0]
i=0
self.assertEqual(len(result_list), len(self.reportList))
self.assertEqual((result_list), (self.reportList))
id_list = []
Expand Down

0 comments on commit 7c61ee6

Please sign in to comment.