Coe, Colin C. (Unix Engineer) wrote:
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.
------------------------------------------------------------------------
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel
Colin,
I have applied the patch to Spacewalk 0.3. Prior to applying the
patch, I did make one minor change to add 'hostname' to the
ServerSerializer header. This will allow it to be included in the api
documentation.
One additional thing to be aware of , is that this change will result in
the hostname being included in the system.getDetails() result as well as
systemgroup.listSystems() result. (These api calls share the same
serializer).
To see the commit, refer to:
http://git.fedorahosted.org/git/?p=spacewalk.git;a=commit;h=ed1da6fc6710fce4adcfa23075a76a8c19747e88
At this point, all of the api patches that you submitted, should have
now been applied.
Once again :), thanks for the contribution !
cheers,
Brad
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel