Bug 587096 - API should have a method telling whether it's a spacewalk or satellite
Summary: API should have a method telling whether it's a spacewalk or satellite
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 0.8
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space13
TreeView+ depends on / blocked
 
Reported: 2010-04-28 21:21 UTC by Sandro Mathys
Modified: 2011-01-20 07:14 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-01-20 07:14:31 UTC
Embargoed:


Attachments (Terms of Use)

Description Sandro Mathys 2010-04-28 21:21:36 UTC
Both satellite and spacewalk should have an api call that can be called to find out whether it's a spacewalk or a satellite as one might want to have his script behave differently for those cases.

Right now it's possible to figure out with what kind of system one's dealing by calling listRedHatChannels or listSoftwareEntitlements but there should be a dedicated method for this in the api namespace. One reason for this is that a session key shouldn't be necessary to get this intelligence.

Comment 1 Sandro Mathys 2010-04-28 21:24:18 UTC
Re-assigning to Justin as agreed upon on IRC.

Comment 2 Jan Pazdziora (Red Hat) 2010-10-27 08:32:44 UTC
Mass-aligning under space12, so that we don't lose track of this bugzilla. This however does not mean that we plan (will be able to) address this bug in Spacewalk 1.2.

Comment 3 Jan Pazdziora (Red Hat) 2010-11-19 16:04:20 UTC
Mass-moving to space13.

Comment 4 Miroslav Suchý 2011-01-19 21:55:00 UTC
Why you would like to distinguish it?

a) there is no real reason for it, IMO. Can you give me some use case?

b) you can call getVersion (or what is the name). value < 3 means Spacewalk. > 4 means Satellite.

Comment 5 Sandro Mathys 2011-01-19 22:05:07 UTC
a) Because it might just be necessary to know. Do I handle a limited amount of entitlements or a virtually unlimited? Do I need to call listRedHatChannels? You know there's more differences.

Basically I have different API scripts that I apply to both our satellites and our spacewalks. They are all set up as identically as possible but there are differences. Issuing one API call to know what kind of system the script is dealing with is much better than e.g. to look what listRedHatChannels returns.

b) okay, I figure that's a good enough idea. But only if spacewalk keeps its version < 3 forever ;)

---

So I agree there's ways to do this without having a special API call but would it really hurt that much to implement it?

Comment 6 Miroslav Suchý 2011-01-20 07:14:31 UTC
> So I agree there's ways to do this without having a special API call but would
it really hurt that much to implement it?

It is dangerous way (from programmers POV). You should not check version of product, or name of product. And that is valid generally for all products, not just Satellite/Spacewalk.
What you should check is version of API or capabilities.

E.g. I have Spacewalks with RedHat Channels, so it returns me same values on both Spacewalk and Satellite.

If you want to behave differentaly on system where you have virtually unlimited entitlements (e.g. Spacewalk) you should use API call satellite.listEntitlements.

I will close this bug for now. But we can continue in discussion here, or on mailing list (to let know others as well).
And if you send patch you will persuade me much easier :)


Note You need to log in before you can comment on or make changes to this bug.