Skip to content

Commit 2e3644c

Browse files
authored
Merge pull request #485 from cglewis/master
defaults for config and log files; bump version
2 parents 0663e3c + f39dff1 commit 2e3644c

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016-2017 In-Q-Tel, Inc, All Rights Reserved.
1+
Copyright (c) 2016-2018 In-Q-Tel, Inc, All Rights Reserved.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.1.3-dev
1+
v0.1.3

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@
5050

5151
# General information about the project.
5252
project = u'poseidon'
53-
copyright = u'2017, dgrossman'
54-
author = u'dgrossman'
53+
copyright = u'2016-2018, In-Q-Tel, Inc'
54+
author = u'Cyber Reboot'
5555

5656
# The version info for the project you're documenting, acts as replacement for
5757
# |version| and |release|, also used in various other places throughout the
5858
# built documents.
5959
#
6060
# The short X.Y version.
61-
version = u'0.1.3-dev'
61+
version = u'0.1.3'
6262
# The full version, including alpha/beta/rc tags.
63-
release = u'0.1.3-dev'
63+
release = u'0.1.3'
6464

6565
# The language for content autogenerated by Sphinx. Refer to documentation
6666
# for a list of supported languages.

poseidon/poseidonMonitor/NorthBoundControllerAbstraction/proxy/faucet/parser.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ def __init__(self, mirror_ports=None):
4040

4141
def config(self, config_file, action, port, switch):
4242
switch_found = None
43-
if config_file:
44-
# TODO check for other files
43+
# TODO check for other files
44+
if not config_file:
45+
# default to FAUCET default
46+
config_file = '/etc/ryu/faucet/faucet.yaml'
47+
try:
4548
stream = open(config_file, 'r')
4649
obj_doc = yaml.safe_load(stream)
4750
stream.close()
48-
else:
51+
except Exception as e:
4952
return False
5053

5154
if action == 'mirror':
@@ -123,8 +126,11 @@ def events(self, event):
123126

124127
def log(self, log_file):
125128
mac_table = {}
129+
if not log_file:
130+
# default to FAUCET default
131+
log_file = '/var/log/ryu/faucet/faucet.log'
126132
# NOTE very fragile, prone to errors
127-
if log_file:
133+
try:
128134
with open(log_file, 'r') as f:
129135
for line in f:
130136
if 'L2 learned' in line:
@@ -145,5 +151,7 @@ def log(self, log_file):
145151
mac_table[learned_mac[10]].insert(0, data)
146152
else:
147153
mac_table[learned_mac[10]] = [data]
154+
except Exception as e:
155+
print("%s" % str(e))
148156
return mac_table
149157

0 commit comments

Comments
 (0)