Ejemplo n.º 1
0
 def install(self):
     """
     """
     if self.script:
         bindir = self.buildout["buildout"]["bin-directory"]
         arguments = ""
         for key, value in {
             "exclude": self.exclude,
             "rsync_options": self.rsync_options,
             "port": self.port,
             "source": self.source,
             "target": self.target,
         }.iteritems():
             if value is not None:
                 arguments += "%s='%s', " % (key, value)
         create_script(
             [("%s" % self.name, "collective.recipe.rsync.__init__", "rsync")],
             working_set,
             executable,
             bindir,
             arguments=arguments,
         )
         return tuple()
     else:
         # if we make it this far, script option is not set so we execute
         # as buildout runs
         rsync(
             exclude=self.exclude,
             port=self.port,
             rsync_options=self.rsync_options,
             source=self.source,
             target=self.target,
         )
         return tuple()
 def install(self):
     """
     """
     if self.script:
         bindir = self.buildout['buildout']['bin-directory']
         arguments = ''
         for key, value in {'exclude': self.exclude, 'rsync_options': self.rsync_options, 'port': self.port, 'source': self.source, 'target': self.target}.iteritems():
             if value is not None:
                 arguments += "%s='%s', " % (key, value)
         create_script(
             [
                 (
                     '%s' % self.name,
                     'collective.recipe.rsync.__init__', 'rsync')
             ],
             working_set,
             executable,
             bindir,
             arguments=arguments)
         return tuple()
     else:
         # if we make it this far, script option is not set so we execute
         # as buildout runs
         rsync(
             exclude=self.exclude,
             port=self.port,
             rsync_options=self.rsync_options,
             source=self.source,
             target=self.target,
             )
         return tuple()
    def install(self):
        """
        Called every time the user runs buildout
        """

        # check whether one of source or target is not defined
        # exit with an error message
        if not self.arguments.get('source'):
            LOG.error('Error in part %s: no "source" option specified. '
                      'Add source = /path/to/source' % self.name)
            return

        if not self.arguments.get('target'):
            LOG.error('Error in part %s: no "target" option specified. '
                      'Add target = remotehost:/path/to/target/' % self.name)
            return

        if self.script:
            # the user wants us to create a script called like
            # the part the recipe is configured
            bindir = self.buildout['buildout']['bin-directory']
            script_args = build_script_args(self.arguments)

            create_script(
                [('%s' % self.name,
                  'collective.recipe.rsync.__init__', 'rsync')],
                working_set, executable, bindir,
                arguments=script_args)
        else:
            # if we make it this far, script option is not set so we execute
            # as buildout runs
            rsync(**self.arguments)

        return ()
 def install(self):
     """Installer"""
     # XXX Implement recipe functionality here
     bindir = self.buildout['buildout']['bin-directory']
     arguments = ''
     for key, value in {
         'target': self.target,
         'buildout_file': self.buildout_file,
         'work_dir': self.work_dir,
         'timeout': self.timeout,
         'preremove_old_work_dir': self.preremove_old_work_dir
     }.iteritems():
         if value is not None:
             arguments += "%s='%s', " % (key, value)
     create_script(
         [
             (
                 '%s' % self.name,
                 'collective.recipe.buildoutcache.run', 'maketargz')
         ],
         working_set,
         executable,
         bindir,
         arguments=arguments)
     # Return files that were created by the recipe. The buildout
     # will remove all returned files upon reinstall.
     return tuple()
Ejemplo n.º 5
0
 def install(self):
     """Installer"""
     if self.script:
         bindir = self.buildout['buildout']['bin-directory']
         arguments = "source='%s', target='%s', port='%s'"
         create_script(
             [('%s' % self.name, 'collective.recipe.rsync.__init__', 'rsync')],
             working_set, executable, bindir, arguments=arguments % (
             self.source, self.target, self.port))
         return tuple((bindir + '/' + 'rsync',))
     else:
         # if we make it this far, script option is not set so we execute
         # as buildout runs
         rsync(source=self.source, target=self.target, port=self.port)
         return tuple()
Ejemplo n.º 6
0
 def install(self):
     """
     """
     if self.script:
         bindir = self.buildout['buildout']['bin-directory']
         base_args = {
             'exclude': self.exclude,
             'rsync_options': self.rsync_options,
             'port': self.port,
             'source': self.source,
             'target': self.target,
         }
         arguments = ''
         for key, value in base_args.items():
             if value is not None:
                 arguments += "%s='%s', " % (key, value)
         create_script(
             [
                 (
                     '%s' % self.name,
                     'collective.recipe.rsync.__init__', 'rsync')
             ],
             working_set,
             executable,
             bindir,
             arguments=arguments)
         return tuple()
     else:
         # if we make it this far, script option is not set so we execute
         # as buildout runs
         rsync(
             exclude=self.exclude,
             port=self.port,
             rsync_options=self.rsync_options,
             source=self.source,
             target=self.target,
             )
         return tuple()
 def install(self):
     """Installer"""
     # XXX Implement recipe functionality here
     bindir = self.buildout['buildout']['bin-directory']
     arguments = ''
     for key, value in {
             'target': self.target,
             'buildout_file': self.buildout_file,
             'work_dir': self.work_dir,
             'timeout': self.timeout,
             'preremove_old_work_dir': self.preremove_old_work_dir
     }.iteritems():
         if value is not None:
             arguments += "%s='%s', " % (key, value)
     create_script([('%s' % self.name,
                     'collective.recipe.buildoutcache.run', 'maketargz')],
                   working_set,
                   executable,
                   bindir,
                   arguments=arguments)
     # Return files that were created by the recipe. The buildout
     # will remove all returned files upon reinstall.
     return tuple()