devserver: return correct IsDelta value in Omaha response

The devserver now uses the newly introduced update_payload module to
actually parse payload files and determine whether they are delta/full
with certainty. This fix includes both locally and remotely served
files. Also fixes a potential problem with remote file attribute
fetching.

BUG=chromium-os:37688
TEST=(1) update response contains correct IsDelta value; (2)
api/fileinfo correctly returns is_delta value.
CQ-DEPEND=I8f426f55d2ee7fb0fa265ae4d5ad84f3c68ca702

Change-Id: I7258d81a66a5c763cc62f6800965fe1a57a0008e
Reviewed-on: https://gerrit.chromium.org/gerrit/43537
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/devserver.py b/devserver.py
index 6621e53..8378b76 100755
--- a/devserver.py
+++ b/devserver.py
@@ -300,9 +300,16 @@
       file_sha256 = common_util.GetFileSha256(file_path)
     except os.error, e:
       raise DevServerError('failed to get info for file %s: %s' %
-                           (file_path, str(e)))
-    return json.dumps(
-        {'size': file_size, 'sha1': file_sha1, 'sha256': file_sha256})
+                           (file_path, e))
+
+    is_delta = autoupdate.Autoupdate.IsDeltaFormatFile(file_path)
+
+    return json.dumps({
+        autoupdate.Autoupdate.SIZE_ATTR: file_size,
+        autoupdate.Autoupdate.SHA1_ATTR: file_sha1,
+        autoupdate.Autoupdate.SHA256_ATTR: file_sha256,
+        autoupdate.Autoupdate.ISDELTA_ATTR: is_delta
+    })
 
 
 class DevServerRoot(object):