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

Inconsistent format for get_jids between returners #19018

Closed
Lothiraldan opened this issue Dec 16, 2014 · 5 comments
Closed

Inconsistent format for get_jids between returners #19018

Lothiraldan opened this issue Dec 16, 2014 · 5 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps Returners severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Milestone

Comments

@Lothiraldan
Copy link
Contributor

I'm playing with salt-api and custom returner / master job cache and I have noticed that the runner jobs.list_jobs output's format is inconsistent.

With the default return cache (https://github.com/saltstack/salt/blob/develop/salt/returners/local_cache.py this one I think), the return format is this one:

$ sudo salt-run jobs.list_jobs
20141216150935816100:
    ----------
    Arguments:
    Function:
        test.ping
    StartTime:
        2014, Dec 16 15:09:35.816100
    Target:
        *
    Target-type:
        glob
    User:
        sudo_vagrant

With the mongo_future_return returner (https://github.com/saltstack/salt/blob/develop/salt/returners/mongo_future_return.py#L198), the output is this one:

$ sudo salt-run jobs.list_jobs
- 20141216145311725339
- 20141216145316775106
- 20141216145322743787
- 20141216145552454849
- 20141216150746364392
- 20141216150751466355

I've checked some other returners, some return list (https://github.com/saltstack/salt/blob/develop/salt/returners/memcache_return.py) and some others return dict (https://github.com/saltstack/salt/blob/develop/salt/returners/postgres_local_cache.py#L316).

What is the right format? I'm working on saltpad (https://github.com/tinyclues/saltpad) and prefer to not support multiple format.

@basepi
Copy link
Contributor

basepi commented Dec 16, 2014

So my bet here is that the different master job caches, the data is stored and retrieved differently. So I think it's actually a bug in the returners themselves, not the runner retrieving the data.

@rallytime rallytime added Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists labels Dec 16, 2014
@rallytime rallytime added this to the Approved milestone Dec 16, 2014
@Lothiraldan
Copy link
Contributor Author

Yeah I don't think the runner is bugged, it basically return the output given by the master job cache. And the API just return the output of the job runner.

I doesn't cause a problem until you start using the API, it's impossible to provide a tool using the salt-api if the format change depending on the master job cache used.

I think all the returners should use the same format as the default "one" (https://github.com/saltstack/salt/blob/develop/salt/returners/local_cache.py) so we should maybe make it explicit in a documentation for new returners creation and fix existing returners shipped with SaltStack.

@cachedout
Copy link
Contributor

I agree with what you're saying, though we may want to consider just making either a utility function or a wrapper so that returner authors don't have to reimplement the same return structure by hand each time.

@cachedout cachedout self-assigned this Jan 9, 2015
@rallytime rallytime added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P3 Priority 3 Returners and removed severity-low 4th level, cosemtic problems, work around exists labels Jun 2, 2015
@kerncore
Copy link
Contributor

Hi,

There is no progress with this issue?
That issue is prevent to integrate the saltstack with 3th services, is very important to find the way for identical format return/save for returners (job_cache), may be start from (ext | master)_job_cache which introduced in 2014.7.

Thanks.

@basepi basepi added the Platform Relates to OS, containers, platform-based utilities like FS, system based apps label Jul 28, 2015
@stale
Copy link

stale bot commented Dec 4, 2017

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 Dec 4, 2017
@stale stale bot closed this as completed Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps Returners severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Projects
None yet
Development

No branches or pull requests

5 participants