Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_formulas_conf(self):
# Append Salt formulas bundled with Watchmaker package.
formulas_path = os.sep.join((static.__path__[0], 'salt', 'formulas'))
for formula in os.listdir(formulas_path):
formula_path = os.path.join(self.salt_formula_root, '', formula)
watchmaker.utils.copytree(
os.sep.join((formulas_path, formula)),
formula_path,
force=True
)
# Obtain & extract any Salt formulas specified in user_formulas.
for formula_name, formula_url in self.user_formulas.items():
filename = os.path.basename(formula_url)
file_loc = os.sep.join((self.working_dir, filename))
# Download the formula
self.retrieve_file(formula_url, file_loc)