@@ -369,30 +369,39 @@ def query(
369369
370370
371371def status (
372- url : str = "https://ws-uv.canfar.net/minoc/capabilities" ,
373372 certfile : Optional [str ] = None ,
374- ) -> bool :
373+ ) -> Tuple [ bool , bool ] :
375374 """Check the status of Minoc.
376375
377376 Args:
378- url: Minoc capabilities HEAD endpoint.
379377 certfile: Canfar certificate file.
380378
381379 Returns:
382380 bool: True if Minoc is up, False otherwise.
383381 """
382+ urls : List [str ] = [
383+ "https://ws-uv.canfar.net/minoc/capabilities" ,
384+ "https://ws-uv.canfar.net/luskan/capabilities" ,
385+ ]
384386 if not certfile :
385387 certfile = procure (key = "vospace_certfile" )
386- response = requests .get (url , cert = certfile , allow_redirects = True )
387- try :
388- response .raise_for_status ()
389- except HTTPError as error :
390- logger .error (error )
391- logger .error ("Canfar is down." )
392- return False
393- authorised = response .headers .get ("x-vo-authenticated" )
394- if isinstance (authorised , str ):
395- return True
396- else :
397- logger .error ("Canfar certificate is not valid." )
398- return False
388+ minoc_status = False
389+ luskan_status = False
390+ for index , url in enumerate (urls ):
391+ response = requests .get (url , cert = certfile , allow_redirects = True )
392+ try :
393+ response .raise_for_status ()
394+ authorised = response .headers .get ("x-vo-authenticated" )
395+ if isinstance (authorised , str ):
396+ if index == 0 :
397+ minoc_status = True
398+ else :
399+ luskan_status = True
400+ else :
401+ raise TypeError
402+ except HTTPError as error :
403+ logger .error (error )
404+ logger .error (f"{ url .split ('/' )[3 ]} is down." )
405+ except TypeError :
406+ logger .error ("Canfar certificate is not valid." )
407+ return minoc_status , luskan_status
0 commit comments