How to use the watchmaker.static function in watchmaker

To help you get started, we’ve selected a few watchmaker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plus3it / watchmaker / src / watchmaker / workers / salt.py View on Github external
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)