def render_pulp_sync(self):
        if not self.dj.dock_json_has_plugin_conf('postbuild_plugins',
                                                 'pulp_sync'):
            return

        pulp_registry = self.spec.pulp_registry.value
        docker_v2_registries = [registry
                                for registry in self.spec.registry_uris.value
                                if registry.version == 'v2']

        if pulp_registry and docker_v2_registries:
            self.dj.dock_json_set_arg('postbuild_plugins', 'pulp_sync',
                                      'pulp_registry_name', pulp_registry)

            # First specified v2 registry is the one we'll tell pulp
            # to sync from. Keep the http prefix -- pulp wants it.
            docker_registry = docker_v2_registries[0].uri
            logger.info("using docker v2 registry %s for pulp_sync",
                        docker_registry)

            self.dj.dock_json_set_arg('postbuild_plugins', 'pulp_sync',
                                      'docker_registry', docker_registry)

            # Verify we have either a secret or username/password
            if self.spec.pulp_secret.value is None:
                conf = self.dj.dock_json_get_plugin_conf('postbuild_plugins',
                                                         'pulp_sync')
                args = conf.get('args', {})
                if 'username' not in args:
                    raise OsbsValidationException("Pulp registry specified "
                                                  "but no auth config")
        else:
            # If no pulp registry is specified, don't run the pulp plugin
            logger.info("removing pulp_sync from request, "
                        "requires pulp_registry and a v2 registry")
            self.dj.remove_plugin("postbuild_plugins", "pulp_sync")
Returns a copy of this object.
dataset/ETHPy150Open projectatomic/osbs-client/osbs/build/build_request.py/ProductionBuild.render_pulp_sync--crossover with--dataset/ETHPy150Open pydata/xarray/xarray/core/variable.py/Coordinate.copy