Add default name for the metadata signature file.

If the metadata signature file isn't specified, and a file exists with the
name <payload_file>.metadata-signature, use it for the metadata signature.

BUG=None
TEST=Manual

Change-Id: I193dcbeece659e6fa9da8a7a22b871aa53622ceb
Reviewed-on: https://gerrit.chromium.org/gerrit/49832
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/paycheck.py b/scripts/paycheck.py
index 245b63e..26e5ec5 100755
--- a/scripts/paycheck.py
+++ b/scripts/paycheck.py
@@ -125,6 +125,15 @@
   else:
     parser.error('unexpected number of arguments')
 
+  # By default, look for a metadata-signature file with a name based on the name
+  # of the payload we are checking.
+  if not opts.meta_sig:
+    print "Looking for default signature."
+    default_meta_sig = args[0] + '.metadata-signature'
+    if os.path.isfile(default_meta_sig):
+      opts.meta_sig = default_meta_sig
+      print "Using default signature %s." % opts.meta_sig
+
   return opts, args[0], args[1:]