3939
4040
4141def check_public_release (release : str = None , public : bool = False ) -> bool :
42- """ Check if a release is public
43-
42+ """ Check if a release is public
43+
4444 Checks a given release to see if it is public. A release is public if it
4545 contains "DR" in the release name, and if todays date is <= the release_date
46- as specified in the Tree.
47-
46+ as specified in the Tree.
47+
4848 Parameters
4949 ----------
5050 release : str
@@ -56,15 +56,15 @@ def check_public_release(release: str = None, public: bool = False) -> bool:
5656 -------
5757 bool
5858 If the release if public
59-
59+
6060 Raises
6161 ------
6262 AttributeError
6363 when tree does not have a valid release date for a DR tree config
6464 """
6565 today = datetime .datetime .now ().date ()
6666 release_date = getattr (tree , 'release_date' , None )
67-
67+
6868 # check if tree has a valid release date attr
6969 if release_date is None and "DR" in tree .release :
7070 raise AttributeError ("Cannot find a valid release date in the sdss-tree product. Try upgrading to min. version 3.1.0." )
@@ -118,11 +118,11 @@ def __init__(self, release=None, public=False, mirror=False, verbose=False,
118118 self .templates = tree .paths
119119 if self .release :
120120 self .replant_tree (release = self .release )
121-
121+
122122 # set public and mirror keywords
123123 self .public = check_public_release (release = self .release , public = public )
124124 self .mirror = mirror
125-
125+
126126 # set the server location and remote base
127127 self .set_netloc ()
128128 self .set_remote_base ()
@@ -327,7 +327,7 @@ def extract(self, name, example):
327327 elif re .search ('@healpixgrp[|]' , template ):
328328 template = re .sub ('@healpixgrp[|]' , '{healpixgrp}' , template )
329329 elif re .search ('@configgrp[|]' , template ):
330- template = re .sub ('@configgrp[|]' , '{configgrp}' , template )
330+ template = re .sub ('@configgrp[|]' , '{configgrp}' , template )
331331 if re .search ('@plateid6[|]' , template ):
332332 template = re .sub ('@plateid6[|]' , '{plateid:0>6}' , template )
333333
@@ -444,8 +444,9 @@ def exists(self, filetype, remote=None, **kwargs):
444444 if remote :
445445 # check for remote existence using a HEAD request
446446 url = self .url ('' , full = full )
447+ verify = kwargs .get ('verify' , True )
447448 try :
448- resp = requests .head (url , allow_redirects = True )
449+ resp = requests .head (url , allow_redirects = True , verify = verify )
449450 except Exception as e :
450451 raise AccessError ('Cannot check for remote file existence for {0}: {1}' .format (url , e ))
451452 else :
0 commit comments