Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add networking interface information to support bundle #24

Merged
merged 13 commits into from Jun 9, 2015

Conversation

christ66
Copy link
Member

Add an option to obtain information about the networking interfaces that are part of the computer.

@reviewbybees

byte[] hardwareAddress = ni.getHardwareAddress();

// Do not have permissions or address does not exist
if (hardwareAddress == null || hardwareAddress.length == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As jenkins may only be bound to the loopback I think we should not break but just not dump the hardware address (or dump something special)

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

bos.append(" ** Index - ").append(ni.getIndex()).append("\n");
Enumeration<InetAddress> inetAddresses = ni.getInetAddresses();
while (inetAddresses.hasMoreElements()) {
NetworkInterface networkInterface = networkInterfaces.nextElement();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean to refer to inetAddress here.

@jtnord
Copy link
Member

jtnord commented Jun 8, 2015

👎 also build failure needs investigating.

@christ66
Copy link
Member Author

christ66 commented Jun 8, 2015

@jtnord Fixed.

new Content("nodes/master/networkInterface.md") {
@Override
public void writeTo(OutputStream os) throws IOException {
os.write(getNetworkInterface(Jenkins.getInstance()).getBytes("utf-8"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"utf-8" is implementation specific. Use the mandated "UTF-8" instead.

new Content("nodes/master/networkInterface.md") {
@Override
public void writeTo(OutputStream os) throws IOException {
os.write(getNetworkInterface(Jenkins.getInstance()).getBytes("UTF-8"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW there are at least two UTF_8 constants: Apache Commons and Guava.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use either of those and wait until JDK7 and use StandardCharsets which is even more efficient :-)

@jglick
Copy link
Member

jglick commented Jun 8, 2015

👍

1 similar comment
@jtnord
Copy link
Member

jtnord commented Jun 9, 2015

👍

christ66 added a commit that referenced this pull request Jun 9, 2015
Add networking interface information to support bundle
@christ66 christ66 merged commit 62e67ad into jenkinsci:master Jun 9, 2015
@christ66 christ66 deleted the network branch June 9, 2015 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants