This post will describe the exercises and solutions for week two of Kirk Byers Python for Network Engineers.
The final assignment in week 2 is the following:
IV. You have the following string from "show version" on a Cisco router cisco_ios = "Cisco IOS Software, C880 Software (C880DATA-UNIVERSALK9-M), Version 15.0(1)M4, RELEASE SOFTWARE (fc1)" Note, the string is a single line; there is no newline in the string. How would you process this string to retrieve only the IOS version: ios_version = "15.0(1)M4" Try to make it generic (i.e. assume that the IOS version can change). You can assume that the commas divide this string into four sections and that the string will always have 'Cisco IOS Software', 'Version', and 'RELEASE SOFTWARE' in it.
The first thing we want to do is to split the string into several parts and put them in a list. We were told that we could use the comma as a separator. We’ll print the list and show the type to show what is going on.
cisco_ios_list = cisco_ios.split(",")
print(cisco_ios_list)
print(type(cisco_ios_list))
This gives us the following output:
daniel@daniel-iperf3:~/python/Week2$ python3 ios_version.py ['Cisco IOS Software', ' C880 Software (C880DATA-UNIVERSALK9-M)', '\n Version 15.0(1)M4', Continue reading
To reap the benefits of IIoT, start with modernizing your aging infrastructure.
In 2013, large-scale cloud providers and ISPs decided they had enough of the glacial IETF process of generating YANG models used to describe device configuration and started OpenConfig – a customer-only initiative that quickly created data models covering typical use cases of the founding members (aka “What Does Google Need”).
Read more ...Welcome to Technology Short Take #78! Here’s another collection of links and articles from around the Internet discussing various data center-focused technologies.
Nothing this time around, sorry!