Skip to content

Commit

Permalink
Merge pull request #23 from napalm-automation/fix-script
Browse files Browse the repository at this point in the history
Fix script
  • Loading branch information
mirceaulinic authored Mar 30, 2017
2 parents a5e8781 + 8c9873a commit ec5a0d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion napalm_logs/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def prepare(self):
self.add_option(
'-p', '--port',
dest='port',
type=int,
help=('Listener bind port. Default: {0}'.format(defaults.PORT))
)
self.add_option(
Expand All @@ -116,6 +117,7 @@ def prepare(self):
self.add_option(
'--publish-port',
dest='publish_port',
type=int,
help=('Publisher bind port. Default: {0}'.format(defaults.PUBLISH_PORT))
)
self.add_option(
Expand Down Expand Up @@ -180,7 +182,7 @@ def parse(self, screen_handler):
return cfg


if __name__ == '__main__':
def main():
if '' in sys.path:
sys.path.remove('')
# Temporarily will forward the log entries to the screen
Expand All @@ -193,3 +195,7 @@ def parse(self, screen_handler):
config = nlop.parse(screen)
nl = napalm_logs.NapalmLogs(**config)
nl.start_engine()

if __name__ == '__main__':
main()

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
install_requires=reqs,
entry_points={
'console_scripts': [
'napalm-logs=napalm_logs.scripts.main'
'napalm-logs=napalm_logs.scripts.main:main'
],
}
)

0 comments on commit ec5a0d4

Please sign in to comment.