-
Notifications
You must be signed in to change notification settings - Fork 0
/
cisco_cs_02.py
32 lines (24 loc) · 1007 Bytes
/
cisco_cs_02.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#Program to scan a config file and output objects
#Author: A. Gittins
#Date: 26/10/16
#Version: 2
from ciscoconfparse import CiscoConfParse
configFileName = raw_input("Please provide the name of the config file in the files folder: ")
objectListFileName = raw_input("Please provide the name of the object list file in the files folder: ")
folderPath = '/vagrant/python-apps/cisco_config_scraper/cisco_config_scraper/scripts/files/'
configFile = open(folderPath + configFileName + ".txt", 'r')
objectListFile = open(folderPath + objectListFileName + ".txt", 'r')
#print str(configFile.read())
#print str(objectListFile.read())
for object in objectListFile:
isIn = " is in config"
isNotIn = "is not in config"
loopObject = object
print loopObject
#print ""
for line in configFile:
#debugging print out
print "Starting lookup for " + loopObject
if loopObject in line:
print str(loopObject + isIn)
continue