[CalendarServer-changes] [13359] CalendarServer/trunk/calendarserver/tools/util.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Apr 22 10:21:55 PDT 2014


Revision: 13359
          http://trac.calendarserver.org//changeset/13359
Author:   sagen at apple.com
Date:     2014-04-22 10:21:55 -0700 (Tue, 22 Apr 2014)
Log Message:
-----------
Use print statements in checkDirectory because logging is not set up at this point

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/util.py

Modified: CalendarServer/trunk/calendarserver/tools/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/util.py	2014-04-22 14:02:55 UTC (rev 13358)
+++ CalendarServer/trunk/calendarserver/tools/util.py	2014-04-22 17:21:55 UTC (rev 13359)
@@ -273,11 +273,15 @@
         created by someone else (or mounted, etc.)
     @type wait: boolean
     """
+
+    # Note: we have to use print here because the logging mechanism has not
+    # been set up yet.
+
     if not os.path.exists(dirpath):
 
         if wait:
             while not os.path.exists(dirpath):
-                log.error("Path does not exist: %s" % (dirpath,))
+                print("Path does not exist: %s" % (dirpath,))
                 sleep(1)
         else:
             try:
@@ -288,7 +292,7 @@
             try:
                 os.mkdir(dirpath)
             except (OSError, IOError), e:
-                log.error("Could not create %s: %s" % (dirpath, e))
+                print("Could not create %s: %s" % (dirpath, e))
                 raise ConfigurationError(
                     "%s does not exist and cannot be created: %s"
                     % (description, dirpath)
@@ -308,10 +312,10 @@
                 os.chmod(dirpath, mode)
                 os.chown(dirpath, uid, gid)
             except (OSError, IOError), e:
-                log.error("Unable to change mode/owner of %s: %s"
+                print("Unable to change mode/owner of %s: %s"
                                % (dirpath, e))
 
-            log.info("Created directory: %s" % (dirpath,))
+            print("Created directory: %s" % (dirpath,))
 
     if not os.path.isdir(dirpath):
         raise ConfigurationError("%s is not a directory: %s"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140422/50532afd/attachment.html>


More information about the calendarserver-changes mailing list