You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Di Li <di...@ca.ibm.com> on 2015/06/25 16:49:57 UTC

Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/
-----------------------------------------------------------

Review request for Ambari and Alejandro Fernandez.


Bugs: AMBARI-11854
    https://issues.apache.org/jira/browse/AMBARI-11854


Repository: ambari


Description
-------

In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.


Diffs
-----

  ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
  ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 

Diff: https://reviews.apache.org/r/35876/diff/


Testing
-------

1. unit test
2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.


Thanks,

Di Li


Re: Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

Posted by Di Li <di...@ca.ibm.com>.

> On June 30, 2015, 5:59 p.m., Alejandro Fernandez wrote:
> > ambari-agent/src/main/python/ambari_agent/Facter.py, line 388
> > <https://reviews.apache.org/r/35876/diff/2/?file=995930#file995930line388>
> >
> >     What happens if no match is found?
> >     One code path returns a value, whereas another does not return anything. Should this function return None as default?

Hello Alejandro,

I have updated the code to return None if no values match. The unit tests are also updated.

Thanks.


- Di


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/#review89935
-----------------------------------------------------------


On June 30, 2015, 6:56 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35876/
> -----------------------------------------------------------
> 
> (Updated June 30, 2015, 6:56 p.m.)
> 
> 
> Review request for Ambari and Alejandro Fernandez.
> 
> 
> Bugs: AMBARI-11854
>     https://issues.apache.org/jira/browse/AMBARI-11854
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
>   ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 
> 
> Diff: https://reviews.apache.org/r/35876/diff/
> 
> 
> Testing
> -------
> 
> 1. unit test
> 2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.
> 
> 
> Thanks,
> 
> Di Li
> 
>


Re: Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/#review89935
-----------------------------------------------------------



ambari-agent/src/main/python/ambari_agent/Facter.py (line 388)
<https://reviews.apache.org/r/35876/#comment142827>

    What happens if no match is found?
    One code path returns a value, whereas another does not return anything. Should this function return None as default?


- Alejandro Fernandez


On June 30, 2015, 12:28 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35876/
> -----------------------------------------------------------
> 
> (Updated June 30, 2015, 12:28 p.m.)
> 
> 
> Review request for Ambari and Alejandro Fernandez.
> 
> 
> Bugs: AMBARI-11854
>     https://issues.apache.org/jira/browse/AMBARI-11854
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
>   ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 
> 
> Diff: https://reviews.apache.org/r/35876/diff/
> 
> 
> Testing
> -------
> 
> 1. unit test
> 2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.
> 
> 
> Thanks,
> 
> Di Li
> 
>


Re: Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/#review90270
-----------------------------------------------------------

Ship it!


Ship It!

- Alejandro Fernandez


On June 30, 2015, 6:56 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35876/
> -----------------------------------------------------------
> 
> (Updated June 30, 2015, 6:56 p.m.)
> 
> 
> Review request for Ambari and Alejandro Fernandez.
> 
> 
> Bugs: AMBARI-11854
>     https://issues.apache.org/jira/browse/AMBARI-11854
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
>   ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 
> 
> Diff: https://reviews.apache.org/r/35876/diff/
> 
> 
> Testing
> -------
> 
> 1. unit test
> 2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.
> 
> 
> Thanks,
> 
> Di Li
> 
>


Re: Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

Posted by Di Li <di...@ca.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/
-----------------------------------------------------------

(Updated June 30, 2015, 6:56 p.m.)


Review request for Ambari and Alejandro Fernandez.


Bugs: AMBARI-11854
    https://issues.apache.org/jira/browse/AMBARI-11854


Repository: ambari


Description
-------

In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.


Diffs (updated)
-----

  ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
  ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 

Diff: https://reviews.apache.org/r/35876/diff/


Testing
-------

1. unit test
2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.


Thanks,

Di Li


Re: Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

Posted by Di Li <di...@ca.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/
-----------------------------------------------------------

(Updated June 30, 2015, 12:28 p.m.)


Review request for Ambari and Alejandro Fernandez.


Bugs: AMBARI-11854
    https://issues.apache.org/jira/browse/AMBARI-11854


Repository: ambari


Description
-------

In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.


Diffs (updated)
-----

  ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
  ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 

Diff: https://reviews.apache.org/r/35876/diff/


Testing
-------

1. unit test
2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.


Thanks,

Di Li


Re: Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

Posted by Di Li <di...@ca.ibm.com>.

> On June 30, 2015, 12:27 a.m., Alejandro Fernandez wrote:
> > Thisremoves whitespace from both before making the comparison. Can you explain how this works in the case you mentioned?

Hello Alenjandro,

Thanks for reviewing the code for me.

The code change in this patch does: 
1. Wrap the logic in the "get_ip_address_by_ifname" function with a try/except block (without the try/except, the script exits execution with an exception, thus the err reported in the JIRA)
2. The "get_ip_address_by_ifname" function returns None if it can't find the IP for the network interface passed in.
3. The "for i in re.findall" loop first gets a return value from "get_ip_address_by_ifname" function. This is where you saw the new change >>
 "ip_address_by_iframe = self.get_ip_address_by_ifname(i.strip());". Then do the "if primary_ip == ip_address_by_iframe.strip():" check
   
So the code you asked about was the code for step 3 where the script first gets the value returned from the "get_ip_address_by_ifname" function, then makes sure it's not None, then compares it (after strip it first) with the primary IP the code got earlier on with FQDN.


> On June 30, 2015, 12:27 a.m., Alejandro Fernandez wrote:
> > ambari-agent/src/main/python/ambari_agent/Facter.py, line 384
> > <https://reviews.apache.org/r/35876/diff/1/?file=992157#file992157line384>
> >
> >     semicolon is not needed.
> >     variable should be called ip_address_by_ifname

Please use AMBARI-11854-no-semicolon-right-var-name.patch where both the semicolon and the var name issues are fixed.


- Di


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/#review89832
-----------------------------------------------------------


On June 25, 2015, 2:49 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35876/
> -----------------------------------------------------------
> 
> (Updated June 25, 2015, 2:49 p.m.)
> 
> 
> Review request for Ambari and Alejandro Fernandez.
> 
> 
> Bugs: AMBARI-11854
>     https://issues.apache.org/jira/browse/AMBARI-11854
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
>   ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 
> 
> Diff: https://reviews.apache.org/r/35876/diff/
> 
> 
> Testing
> -------
> 
> 1. unit test
> 2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.
> 
> 
> Thanks,
> 
> Di Li
> 
>


Re: Review Request 35876: AMBARI-11854 ambari-agent fails to start when node has multiple network cards with some does not have IP address

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35876/#review89832
-----------------------------------------------------------


Thisremoves whitespace from both before making the comparison. Can you explain how this works in the case you mentioned?


ambari-agent/src/main/python/ambari_agent/Facter.py (line 384)
<https://reviews.apache.org/r/35876/#comment142650>

    semicolon is not needed.
    variable should be called ip_address_by_ifname


- Alejandro Fernandez


On June 25, 2015, 2:49 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35876/
> -----------------------------------------------------------
> 
> (Updated June 25, 2015, 2:49 p.m.)
> 
> 
> Review request for Ambari and Alejandro Fernandez.
> 
> 
> Bugs: AMBARI-11854
>     https://issues.apache.org/jira/browse/AMBARI-11854
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In a cluster with nodes that has multiple network interfaces. Ambari-agent fails to start due to one or more active network interface did not bind to an IP address. This happens when the eth0 network interface does not have an IP address.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/Facter.py 94a0ab1 
>   ambari-agent/src/test/python/ambari_agent/TestHardware.py 61456c5 
> 
> Diff: https://reviews.apache.org/r/35876/diff/
> 
> 
> Testing
> -------
> 
> 1. unit test
> 2. manually run the script on a cluster where the eth0 network interface does not have an IP address assigned.
> 
> 
> Thanks,
> 
> Di Li
> 
>