Merge -c 1529534 from trunk to branch-2.1-beta to fix YARN-1032. Fixed NPE in RackResolver. Contributed by Lohit Vijayarenu.