22274: Bugfix graphs existence check
authorBrett Smith <brett.smith@curii.com>
Fri, 1 Nov 2024 17:42:55 +0000 (13:42 -0400)
committerBrett Smith <brett.smith@curii.com>
Fri, 1 Nov 2024 18:04:19 +0000 (14:04 -0400)
commit9946f149fe4fd4175841b7cf4592e202a746e6bf
treec7936a1747064720ed1634e3c3060e118410c85d
parentf606947fe9046312471d828ea678ea5586098197
22274: Bugfix graphs existence check

Earlier code always assigns `self.graphs[managed_graph]` and
`self.graphs[storage_graph]`. When the graphs aren't available (e.g.,
because the user doesn't have Prometheus credentials), the values are
None. This would cause us to run `len(None)` and crash with a
TypeError.

Simplify by checking the truthiness of graph data and then calculating
the rest of what we need.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>
tools/cluster-activity/arvados_cluster_activity/report.py