Code review comment for lp:~gmb/maas/add-alerts-for-disconnected-clusters-bug-1341121

Revision history for this message
Graham Binns (gmb) wrote :

On 3 October 2014 12:11, Raphaël Badin <email address hidden> wrote:
>
>
> Diff comments:
>
>> === modified file 'src/maasserver/enum.py'
>> --- src/maasserver/enum.py 2014-09-27 02:22:32 +0000
>> +++ src/maasserver/enum.py 2014-10-03 10:53:21 +0000
>> @@ -41,6 +41,7 @@
>> """Major moving parts of the application that may have failure states."""
>> PSERV = 'provisioning server'
>> IMPORT_PXE_FILES = 'maas-import-pxe-files script'
>> + CLUSTERS = 'clusters'
>
> We might want to have other component errors related to clusters. Maybe this should be renamed "DISCONNECTED_CLUSTERS"

Agreed.

>> class NODE_STATUS:
>>
>> + accepted_clusters = NodeGroup.objects.filter(
>> + status=NODEGROUP_STATUS.ACCEPTED)
>> + disconnected_clusters_found = any(
>> + not cluster.is_connected() for cluster in accepted_clusters)
>> + if disconnected_clusters_found:
>> + register_persistent_error(
>> + COMPONENT.CLUSTERS,
>> + "One or more clusters are currently disconnected. Visit "
>> + "the <a href=\"%s\">clusters</a> page for more "
>
> I think the link should apply to "clusters page" instead of just "clusters" but it's a detail.
>

Fixed.

« Back to merge proposal