-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified getHostname, getFQDN and getCPU to utilize regEX #27
base: master
Are you sure you want to change the base?
Conversation
Merging from main repo
adding extension back in
removing deleted files
merging latest changes
* origin/master: added: getFQDN (as per Yandy's recent modifications) changed: getHostname to only output the hostname, not FQDN added: setLogin (as created by Yandy) added: getInterfaces to iControl (at last) including output of each's MAC, MTU and status added: getInterfaceNumber to iControl & main (number of physical interfaces) added: getVLANNumber (number of L2 interfaces) to iControl & main added: getIPNumber to iControl & main added: getTunnelNumber (IPsec) to iControl & main added: getFQDN (as per Yandy's recent modifications) changed: getHostname to only output the hostname, not FQDN added: setLogin (as created by Yandy) added: getInterfaces to iControl (at last) including output of each's MAC, MTU and status added: getInterfaceNumber to iControl & main (number of physical interfaces) added: getVLANNumber (number of L2 interfaces) to iControl & main added: getIPNumber to iControl & main added: getTunnelNumber (IPsec) to iControl & main
… if version is < 4.13.x
…version is < 4.13.x
Been on vaca for a few days...hoping to get to some of this real soon. |
Vacation? Da h*ll is that? ;) I kid of course. No worries man, but been meaning to port some code I've been working on, but dont' want to fill the queue. Part of what I've been working on Parsing a Routing Table, of course the single run method in device()... and a some other goodies. I also noted a bug in your getRoutes() method in onepk, you use c as a counter, but never increment it. The loop keeps over writing the same index. c = 1
for r in route_list:
routes['route'] = str(r.prefix.address) + '/' + str(r.prefix.prefix_length)
routes['prefix'] = r.prefix.address
routes['prefix_length'] = r.prefix.prefix_length
routes['admin_distance'] = r.admin_distance
routes['type'] = ''
routes['metric'] = ''
all_routes[c] = routes
c += 1 # just add that Look at the last line Enjoy your vaca man, come back rested. |
Modified the three above methods to use regex, should be much more efficient than the 3000 lines of string and list splitting.
still works as expected