Bug 587096 - API should have a method telling whether it's a spacewalk or satellite
API should have a method telling whether it's a spacewalk or satellite
Status: CLOSED WONTFIX
Product: Spacewalk
Classification: Community
Component: API (Show other bugs)
0.8
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Suchý
Red Hat Satellite QA List
:
Depends On:
Blocks: space13
  Show dependency treegraph
 
Reported: 2010-04-28 17:21 EDT by Sandro Mathys
Modified: 2011-01-20 02:14 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-20 02:14:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sandro Mathys 2010-04-28 17:21:36 EDT
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 17:24:18 EDT
Re-assigning to Justin as agreed upon on IRC.
Comment 2 Jan Pazdziora 2010-10-27 04:32:44 EDT
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 2010-11-19 11:04:20 EST
Mass-moving to space13.
Comment 4 Miroslav Suchý 2011-01-19 16:55:00 EST
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 17:05:07 EST
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 02:14:31 EST
> 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.