From a0b4af4e7374501e6c36e305fc3035103006d0d2 Mon Sep 17 00:00:00 2001 From: Sergey Kizunov Date: Mon, 7 Aug 2017 14:09:31 -0500 Subject: [PATCH] Add --skip-grains option to salt-run This will allow the user to skip grains generation and save the 2+ seconds it takes to generate grains for each call to `salt-run`. Grains are not commonly used in runners. Signed-off-by: Sergey Kizunov --- salt/utils/parsers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index 8c4ca33cc7..dc4086f0ba 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -2782,6 +2782,12 @@ class SaltRunOptionParser(six.with_metaclass(OptionParserMeta, action='store_true', help=('Start the runner operation and immediately return control.') ) + self.add_option( + '--skip-grains', + default=False, + action='store_true', + help=('Do not load grains.') + ) group = self.output_options_group = optparse.OptionGroup( self, 'Output Options', 'Configure your preferred output format.' )