Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] bash completion for the targeting with grains/pillars/etc. #24390

Closed
arthurzenika opened this issue Jun 4, 2015 · 10 comments
Closed

[ui] bash completion for the targeting with grains/pillars/etc. #24390

arthurzenika opened this issue Jun 4, 2015 · 10 comments
Labels
Core relates to code central or existential to Salt Feature new functionality including changes to functionality and code refactors, etc. P3 Priority 3 stale
Milestone

Comments

@arthurzenika
Copy link
Contributor

It would be quite cool to have some bash completion on the targeting part of the salt command. The completion could probably get it's information from the salt-key list (not the actual live state of the infrastructure for performance reasons).

I guess a first implementation would be on the glob syntax but we could imagine having a more complete implementation with nodegroups, regexp etc.

@arthurzenika
Copy link
Contributor Author

For grains this could be useful too. I always forget if it is os_family or osfamily for example. Again using a cache for this would be preferable.

@jfindlay jfindlay added Feature new functionality including changes to functionality and code refactors, etc. Core relates to code central or existential to Salt labels Jun 9, 2015
@jfindlay jfindlay added this to the Approved milestone Jun 9, 2015
@jfindlay
Copy link
Contributor

jfindlay commented Jun 9, 2015

@arthurlogilab, thanks for the feature, this would be great.

@arthurzenika
Copy link
Contributor Author

@jfindlay for glob, this is actually already implemented (don't know when, but 2014.7 has it). Updating the title.

For grains, typing tab tab after salt -G 'os:, shows a bunch of calls on the event bus, but ends of as salt -G 'os:' so I guess it's just trying to do the completion on available functions.

@arthurzenika arthurzenika changed the title [ui] bash completion for the targeting [ui] bash completion for the targeting with grains/pillars/etc. Jun 22, 2015
@alekibango
Copy link

hi, i am original author of completion, and i will try to fix it. What is really needed is good caching, as you noticed. Many functions are sluggish.

Low timeout value for reading list of grains (see /etc/bash_completion.d/salt-common, function _salt_get_grains) might even lead to empty list of grains on some systems. Increasing '--timeout 2' might make it work for you.

i will first try to add cache system, update list of available options and fix what is needed to make grains and pillars work well. it will take me some time, though, as it is not easy and I am under high load right now. Probably best will be to create unittesting environment and unittests... The completion is really hard to debug... If you would like to help, especially writing unittests, that would be great. Maybe like this.

@arthurzenika
Copy link
Contributor Author

@alekibango first of all, thanks for the feature.

We'll try to put this in our todo list at some point. We don't really need this first hand, but might have a client that is interested in this. The unittest file from unity3d is a good source of inspiration indeed.

@twangboy twangboy added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P3 Priority 3 labels Aug 25, 2015
@jfindlay jfindlay removed the severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around label Sep 8, 2015
@alekibango
Copy link

I am very sorry, but i did not have time to move forward with this. My growing cloud took all of my time.

@stale
Copy link

stale bot commented Sep 28, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Sep 28, 2018
@arthurzenika
Copy link
Contributor Author

+1 to keep this open

@stale
Copy link

stale bot commented Oct 2, 2018

Thank you for updating this issue. It is no longer marked as stale.

@stale stale bot removed the stale label Oct 2, 2018
@stale
Copy link

stale bot commented Jan 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 9, 2020
@stale stale bot closed this as completed Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core relates to code central or existential to Salt Feature new functionality including changes to functionality and code refactors, etc. P3 Priority 3 stale
Projects
None yet
Development

No branches or pull requests

4 participants