Skip to content

Commit

Permalink
Merge pull request #175 from lorengordon/issue-173
Browse files Browse the repository at this point in the history
Removes formula before copying it from source
  • Loading branch information
lorengordon authored Mar 8, 2017
2 parents 1ac90bc + a7de574 commit 43d0f74
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/watchmaker/workers/salt.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,12 @@ def _get_formulas_conf(self):
# Append Salt formulas that came with Watchmaker package.
formulas_path = os.sep.join((static.__path__[0], 'salt', 'formulas'))
for formula in os.listdir(formulas_path):
shutil.copytree(os.sep.join((formulas_path, formula)),
os.path.join(self.salt_formula_root, '', formula))
formula_path = os.path.join(self.salt_formula_root, '', formula)
if os.path.exists(formula_path):
shutil.rmtree(formula_path)
shutil.copytree(
os.sep.join((formulas_path, formula)),
formula_path)

# Obtain & extract any Salt formulas specified in user_formulas.
for source_loc in self.user_formulas:
Expand Down

0 comments on commit 43d0f74

Please sign in to comment.