python: Don't assume RubyNetwork exists in do_ruby_dot.
python: Don't assume RubyNetwork exists in do_ruby_dot.

If Ruby is disabled, then RubyNetwork is not a SimObject, and
do_ruby_dot which tries to reference it will crash. This more flexibly
checks for RubyNetwork, and if that isn't in m5.objects will gracefully
return instead of crashing.

Also streamline the code in that function a little bit using filter()
instead of preconstructing the list of ruby networks.

Change-Id: Ia4bdb04201df8453a1b6692a2f211b6cde00be2d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/59629
Maintainer: Gabe Black <d3e8afea784ab4a50a2dbf9149d2eaa8478e1cbc@gmail.com>
Reviewed-by: Yu-hsin Wang <6fe4a9bb86bd1d25c6bb6664bd84f1b6720c0b37@google.com>
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>

gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5