Skip to content

Network News is a semi-regular feature that highlights current events in UIT's Network Services group.

Moving TOAST to Python 3.6 will mean cleaner code, better security

L-R: Automation Specialist Chadd Barney, Network Ops Engineer Derek Paniagua, and Network Edge Engineer Nick Bradberry.

L-R: Automation Specialist Chadd Barney, Network Ops Engineer Derek Paniagua, and Network Edge Engineer Nick Bradberry.

We've all felt inconvenienced as our devices finish a software patch or install the latest operating system. But if that wait makes you antsy, consider the days and months, not minutes, often required to migrate IT systems to a new version.

Take, for example, The Online Automated Services Toolkit (TOAST), a network task management platform developed by UIT's Network Operations Center (NOC). Moving TOAST from Python version 2.7 to 3.6 has taken seven months, and counting — a major time commitment from a small group of engineers.

The impetus for the migration, on track for an October 31, 2019 go-live, is that Python 2.7 will no longer be supported after January 1, 2020.

"We want to prevent any fires," said Network Edge Engineer Nick Bradberry, who is leading the project.

Applications or libraries running the older version will not suddenly stop working, but they will be prone to security vulnerabilities. Bradberry also noted that two-factor authentication was added to TOAST on August 27, 2019.

Python is a popular programming language used for developing graphical user interface (GUI) applications, websites, and web applications. It uses simple syntax rules that keeps the code base readable and easy to maintain. Because the TOAST update involves a large codebase, Bradberry, Network Automation Engineer Chadd Barney, and Network Ops Engineer Derek Paniagua have been surveying the code for key language differences between Python 2.7 and 3.6, which aren't automatically compatible.

"It's a major project because there are so many minor changes," Paniagua said.

Because it will be a harder to maintain code that works on both versions after support for 2.7 ends, the team has put a moratorium on adding new tools to TOAST until the migration is complete, outside of emergency changes.

Moving to Python 3.6 solves some fundamental redundancies in the language, Bradberry said. While end users of TOAST ultimately won't see differences to the interface, it should result in more simple and elegant code. In the short-term, the ACI Tools module in the left-hand navigation may be removed for a short time, but the small subset of employees who use the Cisco-developed tool would be able to access it on a development server. ACI Tools may be taken off-line, so to speak, to keep the project on track. All functionality would be preserved in the development server, and the tool could still be developed inside a Docker container.

Bradberry has to learn the application in its entirety, and because it functions differently in Python 3.6, is rewriting all of the code from scratch.

"Rewriting someone else’s code is honestly not something programmers love doing, but it's part of the process," Bradberry said. Noting the conversion isn’t one-to-one, Paniagua added, "Rather than repainting a painting, it’s like making a sculpture out of the old painting."

In addition to revising code, the team is conducting manual tests and writing unit tests. Unit tests ensure individual units (or components) of a software perform as designed. Code coverage is the percentage of code that is covered by automated tests, which Paniagua said is at about 20 percent, with the goal of 90 to 95 percent. That is a separate project that will take more time, and possibly involve student employees.

After 10/31, the team asks TOAST users to report any issues using the feedback mechanism within the platform. 

Share this article:


Node 4

Our monthly newsletter includes news from UIT and other campus/ University of Utah Health IT organizations, features about UIT employees, IT governance news, and various announcements and updates.



Featured Posts

Last Updated: 4/11/22