Seagate / halon

High availability solution
Apache License 2.0
1 stars 0 forks source link

HALON-887: Tag principal RM in `hctl mero status` output #1535

Closed rajanikantchirmade closed 5 years ago

vvv commented 5 years ago

merged

vvv commented 5 years ago

enabled an automatic merge when the pipeline for 1d7dacbbfbb0d167d77a8f0263633308059bb960 succeeds

vvv commented 5 years ago

added 1 commit

Compare with previous version

vvv commented 5 years ago

enabled an automatic merge when the pipeline for d1c2cfead6b1449f5ca67bb79441cc4066842313 succeeds

vvv commented 5 years ago

added 1 commit

Compare with previous version

vvv commented 5 years ago

changed title from HALON-887: {-Add [TS], [RC], [principalRM] tags in hctl mero status-} to HALON-887: {+Tag principal RM in hctl mero status output+}

vvv commented 5 years ago

If the last string value is an empty string, then this line will have trailing whitespace. We can do better than that.

vvv commented 5 years ago

added 2 commits

Compare with previous version

vvv commented 5 years ago

changed this line in version 3 of the diff

vvv commented 5 years ago

One :: String would suffice for type inference to do its job.

The definition can be simplified to

     rmTag :: Maybe M0.Service -> M0.Service -> String
     rmTag (Just prm) svc | prm == svc = " (principal)"
     rmTag _ _                         = ""

But I'd suggest to define rmTag right near the place where it is used:

             let (serv_st, serv_extSt) = M0.displayServiceState sst
                 rmTag | Just svc == csrPrincipalRM = " (principal)"
                       | otherwise                  = ""
             printf serv_pattern serv_st (fidStr svc) (show $ M0.s_type svc) rmTag
rajanikantchirmade commented 5 years ago

added 8 commits

Compare with previous version