Add update_port function, testcase for port and subnet rename

can you run it through autopep8