Index: b/cloud.cfg
===================================================================
--- a/cloud.cfg	2012-07-03 10:24:31.565194553 +0200
+++ b/cloud.cfg	2012-07-03 10:26:20.357734024 +0200
@@ -2,3 +2,4 @@
 user: ubuntu
 disable_root: 1
 preserve_hostname: False
+log_cfg: built_in_log
Index: b/cloud-init-cfg.py
===================================================================
--- a/cloud-init-cfg.py	2012-07-03 10:18:28.003391747 +0200
+++ b/cloud-init-cfg.py	2012-07-03 10:19:02.011560384 +0200
@@ -60,7 +60,10 @@
     if os.environ.has_key(cfg_env_name):
         cfg_path = os.environ[cfg_env_name]
 
-    cc = cloudinit.CloudConfig.CloudConfig(cfg_path)
+    try:
+        cc = cloudinit.CloudConfig.CloudConfig(cfg_path)
+    except cloudinit.DataSourceNotFoundException:
+        fail("No instance data found", log)
 
     module_list = [ ]
     if name == "all":
Index: b/cloudinit/DataSourceEc2.py
===================================================================
--- a/cloudinit/DataSourceEc2.py	2012-07-03 10:21:09.604193077 +0200
+++ b/cloudinit/DataSourceEc2.py	2012-07-03 10:21:36.316325539 +0200
@@ -89,7 +89,7 @@
             return 'http://archive.ubuntu.com/ubuntu/'
 
 
-    def wait_for_metadata_service(self, sleeps = 100):
+    def wait_for_metadata_service(self, sleeps = 30):
         sleeptime = 1
         address = '169.254.169.254'
         starttime = time.time()
@@ -120,7 +120,7 @@
                 (time.strftime("%H:%M:%S"), x+1, sleeps, reason))
             time.sleep(sleeptime)
 
-        cloudinit.log.critical("giving up on md after %i seconds\n" %
+        cloudinit.log.critical("giving up on metadata after %i seconds\n" %
                   int(time.time()-starttime))
         return False
 
Index: b/cloudinit/__init__.py
===================================================================
--- a/cloudinit/__init__.py	2012-07-03 10:19:42.563761468 +0200
+++ b/cloudinit/__init__.py	2012-07-03 10:27:30.934083988 +0200
@@ -126,6 +126,21 @@
     def emit(self, record):
         pass
 
+    def close(self):
+        """
+        Replace the parent method with our own copy since it's broke in
+        Python2.4 :-(
+        """
+        #get the module data lock, as we're updating a shared structure.
+        logging._acquireLock()
+        try:    #unlikely to raise an exception, but you never know...
+            if self in logging._handlers: #this is missing in the original
+                del logging._handlers[self]
+            if self in logging._handlerList: #this is missing in the original
+                logging._handlerList.remove(self)
+        finally:
+            logging._releaseLock()
+
 log = logging.getLogger(logger_name)
 log.addHandler(NullHandler())
 
@@ -150,6 +165,10 @@
         logcfg = "%s\n%s" % (built_in_log_base,
                              built_in_log_cloudLogHandlerSyslog)
         builtin = True
+    elif logcfg.lower() == "built_in_log":
+        logcfg = "%s\n%s" % (built_in_log_base,
+                             built_in_log_cloudLogHandlerLog)
+        builtin = True
 
     logcfg = logcfg.replace("__CLOUDINIT_LOGGER_FILE__", logfile)
     try:
Index: b/cloud-init.py
===================================================================
--- a/cloud-init.py	2012-07-03 10:22:12.824506570 +0200
+++ b/cloud-init.py	2012-07-03 10:23:59.481035447 +0200
@@ -26,8 +26,10 @@
 import logging
 import errno
 
-def warn(lstr):
-    sys.stderr.write(lstr)
+def warn(msg, log=None):
+    if log:
+        log.warn(msg)
+    sys.stderr.write(msg)
 
 def main():
     cmds = ( "start", "start-local" )
@@ -86,7 +88,7 @@
         cloud.sem_and_run("consume_userdata", "once-per-instance",
             cloud.consume_userdata, [], False)
     except:
-        warn("consuming user data failed!\n")
+        warn("consuming user data failed!\n", log)
         raise
 
     try:
@@ -99,7 +101,7 @@
             cloud.sem_and_run("update_hostname", "always",
                 update_hostname, [ hostname, log ], False)
     except:
-        warn("failed to set hostname\n")
+        warn("failed to set hostname\n", log)
 
     #print "user data is:" + cloud.get_user_data()
 
@@ -108,7 +110,7 @@
         cloud.sem_and_run("set_defaults", "once-per-instance",
             set_defaults, [ cloud ], False)
     except:
-        warn("failed to set defaults\n")
+        warn("failed to set defaults\n", log)
 
     # finish, send the cloud-config event
     cloud.initctl_emit()
