Skip to content

Commit

Permalink
fix Tool._patch: no need to check return code because it is always ze…
Browse files Browse the repository at this point in the history
…ro, unless exception is thrown
  • Loading branch information
dpark01 committed Jun 18, 2016
1 parent 21cd253 commit 5975539
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,8 @@ def executable_path(self):
return os.path.join(self.bin_path, self.executable)

def apply_patches(self):
result = None
for path, patch in self.patches:
result = self._patch(path, patch)
if result.returncode != 0:
return result
return result
self._patch(path, patch)


def _patch(self, path, patch):
Expand All @@ -340,7 +336,7 @@ def _patch(self, path, patch):
file_path = os.path.join(self.env_path, path)
patch_path = os.path.join(
util.file.get_project_path(), 'tools', 'patches', patch)
return subprocess.check_call(['patch', file_path, patch_path])
subprocess.check_call(['patch', file_path, patch_path])

@property
def _package_installed(self):
Expand Down Expand Up @@ -533,10 +529,7 @@ def install_package(self):

if data["success"] == True:
_log.debug("Package installed.")
result = self.apply_patches()
if result and result.returncode != 0:
_log.error("Failed to apply patches.")
return
self.apply_patches()

else:
if "success" in data.keys() and data["success"]:
Expand Down

0 comments on commit 5975539

Please sign in to comment.