Bug 501376

Summary: system.applyErrata and scheduleApplyErrata shouldn't have different names
Product: Red Hat Satellite 5 Reporter: Sayli Karmarkar <skarmark>
Component: APIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: Sayli Karmarkar <skarmark>
Severity: low Docs Contact:
Priority: low    
Version: 530CC: cperry, jsefler
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:55:48 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: 456996    

Description Sayli Karmarkar 2009-05-18 20:20:55 UTC
Description of problem:
system.applyErrata and  scheduleApplyErrata are doing the exact same thing. I guess scheduleApplyErrata was added later to be able to provide earliest date when it should be scheduled. So, scheduleApplyErrata has extra parameter  Date earliestOccurrence. 

Howevere, as the functionality is exact same, they should have same name. scheduleApplyErrata seems like better name as the actual action is scheduling and not applying immediately. 


Expected results:
1. scheduleApplyErrata(String sessionKey, Integer sid, List errataIds, 
            Date earliestOccurrence)
2. scheduleApplyErrata(String sessionKey, Integer sid, List errataIds)
3. Deprecate ApplyErrata(String sessionKey, Integer sid, List errataIds)

Comment 1 Brad Buckingham 2009-05-20 18:45:11 UTC
master git commit: a9de21801c2ab2a57e722b2f573a3b8b7adfec10
vader git commit: 36210ed5bf68392d2965a3092bc44a5002fecb9a

Comment 2 Sayli Karmarkar 2009-05-29 19:01:36 UTC
verified. Added api tests.

Comment 3 John Sefler 2009-08-27 14:02:47 UTC
Verified on staged (Satellite-5.3.0-RHEL5-re20090724.0) with updates from Aug 20, 2009

executed API test:
[jsefler@jsefler rpcapi]$ ant -Dtestcase=scheduleApplyErrata
......
invoke-tests-testcase:
     [echo] 
     [echo] --------------------------------------------------------------------
     [echo] Running scheduleApplyErrata ...
     [echo] --------------------------------------------------------------------
     [echo]       
    [mkdir] Created dir: /home/jsefler/workspace/rpcapi/reports
    [junit] Running com.redhat.rhn.rpc.api.system.scheduleApplyErrata
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 10.628 sec


Also verified API docs:
click Help|About > API > system > applyErrata (verified that it is deprecated)
https://sun-x4200-01.rhts.bos.redhat.com/rhn/apidoc/handlers/SystemHandler.jsp#applyErrata
Method: applyErrata
Description:
Schedules an action to apply errata updates to a system.

Deprecated as of version - being replaced by system.scheduleApplyErrata(string sessionKey, int serverId, array[int errataId])

Parameters:

    * string sessionKey
    * int serverId
    * array:
          o int - errataId

Returns:

    * int - 1 on success, exception thrown otherwise. 



click Help|About > API > system > scheduleApplyErrata
https://sun-x4200-01.rhts.bos.redhat.com/rhn/apidoc/handlers/SystemHandler.jsp#scheduleApplyErrata

 Method: scheduleApplyErrata
Description:
Schedules an action to apply errata updates to a system.

Parameters:

    * string sessionKey
    * int serverId
    * array:
          o int - errataId

Returns:

    * int - 1 on success, exception thrown otherwise. 

Available since: 10.6

Method: scheduleApplyErrata
Description:
Schedules an action to apply errata updates to a system at a given date/time.

Parameters:

    * string sessionKey
    * int serverId
    * array:
          o int - errataId
    * dateTime.iso8601 earliestOccurrence

Returns:

    * int - 1 on success, exception thrown otherwise. 


moving to RELEASE_PENDING:

Comment 4 Brandon Perkins 2009-09-10 19:55:48 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html