comparison tincan.py @ 66:f33cb3e93473 draft

Fix bad log invocations.
author David Barts <n5jrn@me.com>
date Fri, 12 Jul 2019 20:27:52 -0700
parents 60907204a265
children b5e72129ef72
comparison
equal deleted inserted replaced
65:d59811b95a62 66:f33cb3e93473
858 and never un-modifies it. 858 and never un-modifies it.
859 """ 859 """
860 # Sanity checks 860 # Sanity checks
861 if not self.urlroot.startswith("/"): 861 if not self.urlroot.startswith("/"):
862 self.errors = 1 862 self.errors = 1
863 self.logger("urlroot not absolute: {0!r}".format(self.urlroot)) 863 self.logger.error("urlroot not absolute: %r", self.urlroot)
864 return self 864 return self
865 if not os.path.isdir(self.fsroot): 865 if not os.path.isdir(self.fsroot):
866 self.errors = 1 866 self.errors = 1
867 self.logger("no such directory: {0!r}".format(self.fsroot)) 867 self.logger.error("no such directory: %r", self.fsroot)
868 return self 868 return self
869 # Make any needed directories. Refuse to launch things that don't 869 # Make any needed directories. Refuse to launch things that don't
870 # contain WEB-INF, to prevent accidental launches of undesired 870 # contain WEB-INF, to prevent accidental launches of undesired
871 # directory trees containing sensitive files. 871 # directory trees containing sensitive files.
872 winf = os.path.join(self.fsroot, _WINF) 872 winf = os.path.join(self.fsroot, _WINF)
873 if not os.path.isdir(winf): 873 if not os.path.isdir(winf):
874 self.errors = 1 874 self.errors = 1
875 self.logger("no WEB-INF directory in {0!r}".format(self.fsroot)) 875 self.logger.error("no WEB-INF directory in %r", self.fsroot)
876 return self 876 return self
877 lib = os.path.join(winf, "lib") 877 lib = os.path.join(winf, "lib")
878 for i in [ lib ]: 878 for i in [ lib ]:
879 if not os.path.isdir(i): 879 if not os.path.isdir(i):
880 os.mkdir(i) 880 os.mkdir(i)