Fix field name changes for size and last modified for gsutil ls -L.

Review URL: https://chromiumcodereview.appspot.com/11338019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/gsd_generate_index@164759 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gsd_generate_index.py b/gsd_generate_index.py
index 533a475..a130c20 100755
--- a/gsd_generate_index.py
+++ b/gsd_generate_index.py
@@ -56,10 +56,24 @@
   assert p.returncode == 0
   # Extract intersting fields.
   fields = {}
-  fields['size'] = FixupSize(re.search('\tObject size:\t([0-9]+)\n',
-                                       p_stdout).group(1))
-  fields['md5'] = re.search('\t(MD5|Etag):\t([^\n]+)\n', p_stdout).group(2)
-  fields['date'] = re.search('\tLast mod:\t([^\n]+)\n', p_stdout).group(1)
+  size_search = re.search('\tContent-Length:\t([0-9]+)\n', p_stdout)
+  if size_search:
+    fields['size'] = FixupSize(size_search.group(1))
+  else:
+    fields['size'] = None
+
+  md5_search = re.search('\t(MD5|Etag):\t([^\n]+)\n', p_stdout)
+  if md5_search:
+    fields['md5'] = md5_search.group(2)
+  else:
+    fields['md5'] = None
+
+  date_search = re.search('\tCreation time:\t([^\n]+)\n', p_stdout)
+  if date_search:
+    fields['date'] = date_search.group(1)
+  else:
+    fields['date'] = None
+
   return fields