Skip to content

Fix for double output with static salt cli/v2015.2 - #23380

Merged
jfindlay merged 2 commits into
saltstack:2015.2from
gladiatr72:fix_for_double_output_with_static__salt_CLI/v2015.2
May 5, 2015
Merged

jfindlay merged 2 commits into
saltstack:2015.2from
gladiatr72:fix_for_double_output_with_static__salt_CLI/v2015.2

Conversation

@gladiatr72

Copy link
Copy Markdown
Contributor

resubmitted to the correct branch

Fix for incorrect output with salt CLI --static option

When the static option was used outside the context of the batch option
the output would appear thusly:

salt -s 'seed*ord' test.ping --out json
{
    "seed-02.pgsql.revsys.000.lab.rackspace.ord": true,
    "seed-01.pgsql.revsys.000.lab.rackspace.ord": true,
    "seed-03.pgsql.revsys.000.lab.rackspace.ord": true
}
{
    "seed-03.pgsql.revsys.000.lab.rackspace.ord": true
}
{
    "seed-02.pgsql.revsys.000.lab.rackspace.ord": true
}
{
    "seed-01.pgsql.revsys.000.lab.rackspace.ord": true
}

Using the default outputter results in minion responses being displayed twice.

If it is used with the batch option, it Does The Right Thing. Since batch needs logic to take care of the presense of static, it made sense to me to remove the if options.static: bits from the else half of theif options.batch:, extending it to if options.batch or options.static: and adding if not options.batch: self.config['batch'] = '100%' to make cli.batch.Batch() happy.

gladiatr72 added 2 commits May 4, 2015 19:16
When the ``static`` option was used outside the context of the ``batch`` option
the output would appear thusly:

```bash
salt -s 'seed*ord' test.ping --out json
```

```json
{
    "seed-02.pgsql.revsys.000.lab.rackspace.ord": true,
    "seed-01.pgsql.revsys.000.lab.rackspace.ord": true,
    "seed-03.pgsql.revsys.000.lab.rackspace.ord": true
}
{
    "seed-03.pgsql.revsys.000.lab.rackspace.ord": true
}
{
    "seed-02.pgsql.revsys.000.lab.rackspace.ord": true
}
{
    "seed-01.pgsql.revsys.000.lab.rackspace.ord": true
}
```

Using the default outputter results in minion responses being displayed twice.

If it is used with the ``batch`` option, it Does The Right Thing. Since
``batch`` needs logic to take care of the presense of ``static``, it made
sense to me to remove the `if options.static:` bits from the else half
of the `if options.batch:`, extending it to `if options.batch or
options.static:` and adding
`if not options.batch: self.config['batch'] = '100%'` to make cli.batch.Batch()
happy.
jfindlay added a commit that referenced this pull request May 5, 2015
…static__salt_CLI/v2015.2

Fix for double output with static  salt cli/v2015.2
@jfindlay
jfindlay merged commit a977776 into saltstack:2015.2 May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants