Modify some problems for firmware update test

Modify problems about path for firmware update test. Also, remove an method
which is unused after modify the way of test.

BUG=chrome-os-partner:12442
TEST=Used by some server tests associated with firmware update

Change-Id: I2a8e81273a3feaf1b6b828bbdeb63233fc612aac
Reviewed-on: https://gerrit.chromium.org/gerrit/30842
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Ready: Chun-Ting Chang <ctchang@chromium.org>
Tested-by: Chun-Ting Chang <ctchang@chromium.org>
diff --git a/client/cros/faft_client.py b/client/cros/faft_client.py
index 8ec3324..12863a8 100644
--- a/client/cros/faft_client.py
+++ b/client/cros/faft_client.py
@@ -525,6 +525,9 @@
         Devkeys are copied to _key_path. Then, shellball,
         /usr/sbin/chromeos-firmwareupdate, is extracted to _work_path.
         """
+
+        self.cleanup_firmwareupdate_temp_dir()
+
         os.mkdir(self._temp_path)
         os.chdir(self._temp_path)
 
@@ -555,7 +558,8 @@
 
     def cleanup_firmwareupdate_temp_dir(self):
         """Cleanup temporary directory."""
-        shutil.rmtree(self._temp_path)
+        if os.path.isdir(self._temp_path):
+            shutil.rmtree(self._temp_path)
 
 
     def repack_firmwareupdate_shellball(self, append):
@@ -570,9 +574,10 @@
             os.path.join(self._temp_path,
                          'chromeos-firmwareupdate-%s' % append))
 
-        self.run_shell_command(
-                'sh %schromeos-firmwareupdate-%s  --sb_repack %s'
-                % (self._temp_path, append, self._work_path))
+        self.run_shell_command('sh %s  --sb_repack %s' % (
+            os.path.join(self._temp_path,
+                         'chromeos-firmwareupdate-%s' % append),
+            self._work_path))
 
         args = ['-i']
         args.append('"s/TARGET_FWID=\\"\\(.*\\)\\"/TARGET_FWID=\\"\\1.%s\\"/g"'
@@ -652,11 +657,6 @@
         return self._temp_path
 
 
-    def get_keys_path(self):
-        """Get temporary ke path."""
-        return self._keys_path
-
-
     def cleanup(self):
         """Cleanup for the RPC server. Currently nothing."""
         pass