Skip to content

Commit

Permalink
DEP: shadowsever parser: setting feed.code
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Wagner <[email protected]>
  • Loading branch information
sebix committed Aug 26, 2016
1 parent 6cec2e5 commit 84ac137
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions intelmq/bots/parsers/shadowserver/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def init(self):
if self.parameters.override:
self.override = True

# Already warned about deprecation
self.depr_warning = False

def parse(self, report):
raw_report = utils.base64_decode(report["raw"])
csvr = csv.DictReader(io.StringIO(raw_report))
Expand Down Expand Up @@ -156,6 +159,13 @@ def parse_line(self, row, report):

# Now add additional constant fields.
dict.update(event, conf.get('constant_fields', {})) # TODO: rewrite in 1.0
if 'feed.code' in conf.get('constant_fields', {}).keys() and not self.depr_warning:
self.depr_warning = True
# could not get this working with logging.captureWarnings(True) :(
# TODO: remove from config 1.0
self.logger.warn('`feed.code` will be removed from the constant_fields in '
'default config in favor of the `code` parameter in collectors '
'in 1.0!')

self.logger.debug("Raw_line: {!r}.".format(row))
event.add('raw', self.recover_line(row))
Expand Down

0 comments on commit 84ac137

Please sign in to comment.