Skip to content

Commit

Permalink
fixing minor codefactor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vkotronis committed Feb 28, 2019
1 parent 3aedb31 commit 3f6d666
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backend/core/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,10 +801,11 @@ def bootstrap_redis(self):

redis_pipeline = self.redis.pipeline()
for entry in entries:
# store the origin, neighbor combination for this hijack BGP update
origin = None
neighbor = None
as_path = entry[0]
if len(as_path) > 0:
if as_path:
origin = as_path[-1]
if len(as_path) > 1:
neighbor = as_path[-2]
Expand Down
2 changes: 1 addition & 1 deletion backend/core/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def commit_hijack(
# store the origin, neighbor combination for this hijack BGP update
origin = None
neighbor = None
if len(monitor_event["path"]) > 0:
if monitor_event["path"]:
origin = monitor_event["path"][-1]
if len(monitor_event["path"]) > 1:
neighbor = monitor_event["path"][-2]
Expand Down

0 comments on commit 3f6d666

Please sign in to comment.