Esempio n. 1
0
def _init_bundle(bundle_dir):
    # Create bundle conf file. It doesn't contain anything at time of writing,
    # but its presence on disk signifies that this is a context bundle.
    #
    bundle_filepath = os.path.join(bundle_dir, "bundle.yaml")
    save_yaml(bundle_filepath)

    # init pkg repo
    repo_path = os.path.join(bundle_dir, "packages")
    os.mkdir(repo_path)

    # Bundled repos are always memcached disabled because they're on local disk
    # (so access should be fast); but also, local repo paths written to shared
    # memcached instance could easily clash.
    #
    settings_filepath = os.path.join(bundle_dir, "packages", "settings.yaml")
    save_yaml(settings_filepath, disable_memcached=True)
Esempio n. 2
0
    def _init_bundle(self):
        os.mkdir(self.dest_dir)
        os.mkdir(self._repo_path)

        # bundle.yaml needs to be written even though it's currently empty.
        # This file is used to detect that this is a bundle when the rxt is
        # written (which is needed so variant handle location paths can be made
        # relative).
        #
        bundle_metafile = os.path.join(self.dest_dir, "bundle.yaml")
        with open(bundle_metafile, 'w'):
            pass

        # Bundled repos are always memcached disabled because they're on local disk
        # (so access should be fast); but also, local repo paths written to shared
        # memcached instance could easily clash.
        #
        settings_filepath = os.path.join(self._repo_path, "settings.yaml")
        save_yaml(settings_filepath, disable_memcached=True)
Esempio n. 3
0
 def _finalize_bundle(self):
     # write metafile
     bundle_metafile = os.path.join(self.dest_dir, "bundle.yaml")
     save_yaml(bundle_metafile, logs=self.logs)