firmware_programmer: handle servo v4 with micro and ccd

BUG=b:35579416
BRANCH=none
TEST=run provision_FirmwareUpdate

Change-Id: I25c755ca2859baca603992c1ae84d422172e411e
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1758926
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
diff --git a/server/cros/servo/servo.py b/server/cros/servo/servo.py
index 23dd258..65e4d41 100644
--- a/server/cros/servo/servo.py
+++ b/server/cros/servo/servo.py
@@ -907,13 +907,27 @@
                                     args=args).stdout.strip()
 
 
-    def get_servo_version(self):
+    def get_servo_version(self, active=False):
         """Get the version of the servo, e.g., servo_v2 or servo_v3.
 
+        @param active: Only return the servo type with the active device.
         @return: The version of the servo.
 
         """
-        return self._server.get_version()
+        servo_type = self._server.get_version()
+        if '_and_' not in servo_type or not active:
+            return servo_type
+
+        # If servo v4 is using ccd and servo micro, modify the servo type to
+        # reflect the active device.
+        active_device = self.get('active_v4_device')
+        if active_device in servo_type:
+            logging.info('%s is active', active_device)
+            return 'servo_v4_with_' + active_device
+
+        logging.warn("%s is active even though it's not in servo type",
+                     active_device)
+        return servo_type
 
 
     def running_through_ccd(self):