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
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel