findmissing: abandon/restore CL + update db

Added gerrit endpoints to abandon and restore CL's in Gerrit.
Implemented functions to interface with cloudsql and update the table
to track abandoned/restored CL's.

Moved get_current_time to common.py.

Implemented top level main functions which can be called to
abandon/restore a fix. In a later CL I will be setting up the webserver
to integrate with these functions and update the gerrit CL and
reflect that update in the database.

Formatted touched files to have correct line spacing.

BUG=None
TEST=None

Change-Id: I8c78470c4be8ccfd7ae6921f2d988047da3317da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2128681
Tested-by: Hirthanan Subenderan <hirthanan@google.com>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
diff --git a/contrib/findmissing/common.py b/contrib/findmissing/common.py
index 6bf8cd3..407a736 100755
--- a/contrib/findmissing/common.py
+++ b/contrib/findmissing/common.py
@@ -10,6 +10,7 @@
 from __future__ import print_function
 import os
 import re
+import time
 from enum import Enum
 import subprocess
 import MySQLdb
@@ -76,6 +77,11 @@
         self.update_table = _update_table
 
 
+def get_current_time():
+    """Returns DATETIME in specific time format required by SQL."""
+    return time.strftime('%Y-%m-%d %H:%M%:%S')
+
+
 def stable_branch(version):
     """Stable branch name"""
     return 'linux-%s.y' % version
@@ -85,6 +91,7 @@
     """Chromeos branch name"""
     return 'chromeos-%s' % version
 
+
 def search_upstream_sha(kernel_sha):
     """Search for upstream sha that kernel_sha is cherry-picked from.
 
@@ -106,10 +113,12 @@
         return usha
     return usha
 
+
 def patch_link(changeID):
     """Link to patch on gerrit"""
     return 'https://chromium-review.googlesource.com/q/%s' % changeID
 
+
 def update_previous_fetch(db, kernel, branch, last_sha):
     """Updates the previous_fetch table for a kernel branch."""
     c = db.cursor()
@@ -120,6 +129,7 @@
 
     db.commit()
 
+
 def get_kernel_absolute_path(repo_name):
     """Returns absolute path to kernel repositories"""
     return os.path.join(WORKDIR, 'kernel_repositories', repo_name)
@@ -159,6 +169,7 @@
 
     os.chdir(WORKDIR)
 
+
 def get_kernel_metadata(kernel):
     """Returns KernelMetadata for each Kernel Enum"""
     stable_kernel_metadata = KernelMetadata(STABLE_PATH, STABLE_REPO, 'stable_fixes',