Bug in getting network subnet

It will run into exception of 'KeyError': 0, because it should get 'subnets' first from the dictionary.
Signed-off-by: Jiantao He hejiantao5@gmail.com