Hi

I've redone this patch as per your suggestion.

Thanks

CC

> -----Original Message-----
> From: Jesus M. Rodriguez [mailto:[EMAIL PROTECTED] 
> Sent: Monday, 8 September 2008 2:20 AM
> To: Coe, Colin C. (Unix Engineer)
> Cc: [email protected]
> Subject: Re: [Spacewalk-devel] Patch: extend API call 
> system.getDetails
> 
> On Sun, Sep 7, 2008 at 5:11 AM, Coe, Colin C. (Unix Engineer)
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi all
> >
> > Attached is a patch to extend the API call system.getDeatils to also
> > return the system's hostname.  The reason for this is 
> simply that the
> > systems profile name and hostname are not always the same.
> >
> > Comments/criticisms welcome.
> 
> Here are my comments on the patch:
> 
> 1) don't break up the declaration of the variable and its 
> initialization:
> 
>   +        Set networks;
>   +
>   +        networks = new HashSet();
> 
> 2) don't initialize a set or list if you plan to simply assign it
> later on in the code:
> 
>   +        networks = server.getNetworks();
> 
> I would simply do this:
> 
>    Set networks = server.getNetworks();
>    if (networks != null && !networks.isEmpty()) {
>        // we only care about the first one
>        Network net = (Network) networks.iterator().next();
>        helper.add("hostname", net.getHostname());
>    }
>    else {
>        helper.add("hostname", 
> LocalizationService.getInstance().getMessage(
>                "sdc.details.overview.unknown"));
>    }
> 
> Please make the above changes, and resubmit. Other than these 
> comments,
> it looked ok to me.
> 
> Thanks for another great submission.
> jesus
> 

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.

Attachment: 0008-modify-API-call-system.getDetails-to-include-system.patch
Description: 0008-modify-API-call-system.getDetails-to-include-system.patch

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to