You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Attila Doroszlai <ad...@hortonworks.com> on 2017/02/02 13:12:12 UTC

Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

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

Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.


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


Repository: ambari


Description
-------

Avoid recording the traceback for this `KeyError`, which is expected for status commands.


Diffs
-----

  ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
  ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 

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


Testing
-------

Manually tested on local cluster.

Unit tests:

```
$ mvn -pl ambari-agent clean test
...
Ran 455 tests in 15.152s

OK
...
[INFO] BUILD SUCCESS
```


Thanks,

Attila Doroszlai


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Attila Doroszlai <ad...@hortonworks.com>.

> On Feb. 2, 2017, 2:21 p.m., Andrew Onischuk wrote:
> > ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py, line 320
> > <https://reviews.apache.org/r/56225/diff/1/?file=1622199#file1622199line320>
> >
> >     Hi Attila.
> >     
> >     Checking if the key in dictionary before operation looks less hacky to me. 
> >     
> >     What do you think?

Agree, but you know what they say: "never touch working code"


- Attila


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


On Feb. 2, 2017, 2:36 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 2:36 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/#review163966
-----------------------------------------------------------




ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py (line 320)
<https://reviews.apache.org/r/56225/#comment235476>

    Hi Attila.
    
    Checking if the key in dictionary before operation looks less hacky to me. 
    
    What do you think?


- Andrew Onischuk


On Feb. 2, 2017, 1:12 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 1:12 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/#review163968
-----------------------------------------------------------


Ship it!




Ship It!

- Andrew Onischuk


On Feb. 2, 2017, 1:36 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 1:36 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Sebastian Toader <st...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/#review164110
-----------------------------------------------------------


Ship it!




Ship It!

- Sebastian Toader


On Feb. 3, 2017, 11:39 a.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 3, 2017, 11:39 a.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/#review164113
-----------------------------------------------------------


Ship it!




Ship It!

- Dmitro Lisnichenko


On Feb. 3, 2017, 12:39 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 3, 2017, 12:39 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Attila Doroszlai <ad...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/
-----------------------------------------------------------

(Updated Feb. 3, 2017, 11:39 a.m.)


Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.


Changes
-------

Wrote unit test that can fail (with the original `CustomServiceOrchestrator`)


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


Repository: ambari


Description
-------

Avoid recording the traceback for this `KeyError`, which is expected for status commands.


Diffs (updated)
-----

  ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
  ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 

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


Testing
-------

Manually tested on local cluster.

Unit tests:

```
$ mvn -pl ambari-agent clean test
...
Ran 455 tests in 15.152s

OK
...
[INFO] BUILD SUCCESS
```


Thanks,

Attila Doroszlai


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Sandor Magyari <sm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/#review163970
-----------------------------------------------------------


Ship it!




Ship It!

- Sandor Magyari


On Feb. 2, 2017, 1:36 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 1:36 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Sebastian Toader <st...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/#review163969
-----------------------------------------------------------


Ship it!




Ship It!

- Sebastian Toader


On Feb. 2, 2017, 2:36 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 2:36 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.

> On Feb. 2, 2017, 4:19 p.m., Dmitro Lisnichenko wrote:
> > ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py, line 324
> > <https://reviews.apache.org/r/56225/diff/2/?file=1622218#file1622218line324>
> >
> >     I think this assertion makes no sence since we would not get here in case of any (unhandled) exception
> 
> Attila Doroszlai wrote:
>     The point is that the exception is handled (see `except KeyError` in original `CustomServiceOrchestrator`), but the traceback remains "active" (ie. `format_exc()` returns it) later in the same thread.
>     
>     However, you are right that this assertion does not test what I intended: the tested code and the assertion do not run in the same thread, so the exception info is not shared.  I'm still trying to figure out why.  Any ideas?

my guess would be that it only works within the except statement (probably that is a context management related thing)


- Dmitro


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


On Feb. 2, 2017, 3:36 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 3:36 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Attila Doroszlai <ad...@hortonworks.com>.

> On Feb. 2, 2017, 3:19 p.m., Dmitro Lisnichenko wrote:
> > ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py, line 324
> > <https://reviews.apache.org/r/56225/diff/2/?file=1622218#file1622218line324>
> >
> >     I think this assertion makes no sence since we would not get here in case of any (unhandled) exception

The point is that the exception is handled (see `except KeyError` in original `CustomServiceOrchestrator`), but the traceback remains "active" (ie. `format_exc()` returns it) later in the same thread.

However, you are right that this assertion does not test what I intended: the tested code and the assertion do not run in the same thread, so the exception info is not shared.  I'm still trying to figure out why.  Any ideas?


- Attila


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


On Feb. 2, 2017, 2:36 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 2:36 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/#review163971
-----------------------------------------------------------




ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py (line 324)
<https://reviews.apache.org/r/56225/#comment235478>

    I think this assertion makes no sence since we would not get here in case of any (unhandled) exception


- Dmitro Lisnichenko


On Feb. 2, 2017, 3:36 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56225/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2017, 3:36 p.m.)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-19846
>     https://issues.apache.org/jira/browse/AMBARI-19846
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Avoid recording the traceback for this `KeyError`, which is expected for status commands.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
>   ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 
> 
> Diff: https://reviews.apache.org/r/56225/diff/
> 
> 
> Testing
> -------
> 
> Manually tested on local cluster.
> 
> Unit tests:
> 
> ```
> $ mvn -pl ambari-agent clean test
> ...
> Ran 455 tests in 15.152s
> 
> OK
> ...
> [INFO] BUILD SUCCESS
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 56225: AMBARI-19846. ambari-agent.out filled with KeyError

Posted by Attila Doroszlai <ad...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56225/
-----------------------------------------------------------

(Updated Feb. 2, 2017, 2:36 p.m.)


Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Sandor Magyari, and Sebastian Toader.


Changes
-------

Check dict for key instead of catching exception


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


Repository: ambari


Description
-------

Avoid recording the traceback for this `KeyError`, which is expected for status commands.


Diffs (updated)
-----

  ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 9baaf08d6cd1fe38db19a34907d44514bded228d 
  ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 3985c5a21ebcaa5c526b772e8ad13d1bf0427d99 

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


Testing
-------

Manually tested on local cluster.

Unit tests:

```
$ mvn -pl ambari-agent clean test
...
Ran 455 tests in 15.152s

OK
...
[INFO] BUILD SUCCESS
```


Thanks,

Attila Doroszlai