simplify conditions in utils.network due to short-circuit eval
Merge pull request #12925 from hulu/simplify-conds

simplify conditions in utils.network due to short-circuit eval