Bug 587096

Summary: API should have a method telling whether it's a spacewalk or satellite
Product: [Community] Spacewalk Reporter: Sandro Mathys <sandro>
Component: APIAssignee: Miroslav Suchý <msuchy>
Status: CLOSED WONTFIX QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: low    
Version: 0.8CC: msuchy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-20 07:14:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 653453    

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 :)