Exemple #1
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using the queue."""
     interactive = not options['remote']
     discover = OptionBag()
     discover.all = partial(discover_all, interactive=interactive)
     discover.network = partial(discover_network, interactive=interactive)
     discover.single = partial(discover_address, interactive=interactive)
     if options['plugins']:
         if not interactive:
             print(
                 'Limiting plugins not supported on remote execution.',
                 file=sys.stderr,
             )
             sys.exit(2)
         plugin.purge(set(options['plugins'].split(',')))
     self._handle(*args, discover=discover, **options)
Exemple #2
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using Rabbit."""
     discover = OptionBag()
     if options["remote"]:
         discover.all = discover_all.delay
         discover.network = discover_network.delay
         discover.single = discover_single.delay
     else:
         if options["plugins"]:
             plugin.purge(set(options["plugins"].split(",")))
         discover.all = partial(discover_all, interactive=True)
         discover.network = partial(discover_network, interactive=True)
         discover.single = partial(discover_single, interactive=True, clear_down=False)
     try:
         self._handle(*args, discover=discover, **options)
     except ImproperlyConfigured, e:
         print(e.message, file=sys.stderr)
         sys.exit(1)
Exemple #3
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using Rabbit."""
     discover = OptionBag()
     if options['remote']:
         discover.all = discover_all.delay
         discover.network = discover_network.delay
         discover.single = discover_single.delay
     else:
         if options['plugins']:
             plugin.purge(set(options['plugins'].split(',')))
         discover.all = partial(discover_all, interactive=True)
         discover.network = partial(discover_network, interactive=True)
         discover.single = partial(
             discover_single, interactive=True, clear_down=False,
         )
     try:
         self._handle(*args, discover=discover, **options)
     except ImproperlyConfigured, e:
         print(e.message, file=sys.stderr)
         sys.exit(1)
Exemple #4
0
 def handle(self, *args, **options):
     """Dispatches the request to either direct, interactive execution
     or to asynchronous processing using the queue."""
     if DISCOVERY_DISABLED:
         print(
             'Discovery command is deprecated since Ralph 2.0. '
             'Use ralph scan [arguments] instead.',
         )
         sys.exit()
     interactive = not options['remote']
     discover = OptionBag()
     discover.all = partial(discover_all, interactive=interactive)
     discover.network = partial(discover_network, interactive=interactive)
     discover.single = partial(discover_address, interactive=interactive)
     if options['plugins']:
         if not interactive:
             print(
                 'Limiting plugins not supported on remote execution.',
                 file=sys.stderr,
             )
             sys.exit(2)
         plugin.purge(set(options['plugins'].split(',')))
     self._handle(*args, discover=discover, **options)