This will always be true I guess, as the classpath for the shell is decided in the lauch script. Can you rather test for connectivity to the YARN system or something?