Added a way to query cidr for existing subnets

Also fixed a select-from-source function to properly handle empty path

Change-Id: I87c694cfa7725e32956062b63529c3bda5804ba7