Browse Source

injector: ignore comments and empty lines

pull/1/head
Hidden Z 14 years ago
parent
commit
5e8b354f9f
  1. 3
      injector

3
injector

@ -24,6 +24,9 @@ args = parser.parse_args()
f = open(args.hostsfile, 'r') f = open(args.hostsfile, 'r')
for line in f: for line in f:
# ignore comments and empty lines
if line.startswith('#') or line.isspace():
continue
if line.find('=') == -1: if line.find('=') == -1:
print 'Invalid line: %s' % line print 'Invalid line: %s' % line
continue continue

Loading…
Cancel
Save