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

(Updated July 6, 2017, 8:32 a.m.)


Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, 
and Sid Wagle.


Changes
-------

* changed option to `ignore_dependencies`
* added doc
* added package list in failure message


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


Repository: ambari


Description
-------

* Add option in `Package` resource to remove package while leaving its 
dependencies installed
* Add custom action `force_remove_packages`


Diffs (updated)
-----

  ambari-agent/src/test/python/resource_management/TestPackageResource.py 
66227c66a7768aa044f30a1c76d782c5101be678 
  
ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
 21de1839c853794f252a4cb2265b89549a802d88 
  
ambari-common/src/main/python/resource_management/core/providers/package/apt.py 
d095173f07c46842b6e9e38dc933e06a3e43a749 
  
ambari-common/src/main/python/resource_management/core/providers/package/choco.py
 db552964279f509de90d2fde884bfc0fea12f7b0 
  
ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
 ea10a8601430b62bbe216848e1d26a5e8bc16927 
  
ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
 265c1626873bfb98196f102e73bb2dbedee94c80 
  ambari-common/src/main/python/resource_management/core/resources/packaging.py 
e3adc30f46abd3f33670f817421d88270b3e7ade 
  
ambari-server/src/main/resources/custom_action_definitions/system_action_definitions.xml
 0f502568ddfb5da7d5574b2e33c6a354c37d9697 
  
ambari-server/src/main/resources/custom_actions/scripts/force_remove_packages.py
 PRE-CREATION 


Diff: https://reviews.apache.org/r/60655/diff/2/

Changes: https://reviews.apache.org/r/60655/diff/1-2/


Testing
-------

Tested custom action as part of cross-stack upgrade on CentOS7.

Manually tested custom action on Debian 7.6:

```
$ curl -X POST -d '{ "RequestInfo": { "action": "force_remove_packages", 
"parameters": { "package_list": "vim-common" } } }' 
http://localhost:8080/api/v1/clusters/TEST/requests

output.txt:
2017-07-05 12:29:59,400 - Package['vim-common'] {'action': ['remove'], 
'remove_with_dependencies': False}
2017-07-05 12:29:59,411 - Removing package vim-common ('/usr/bin/dpkg --remove 
--ignore-depends vim-common vim-common')
2017-07-05 12:30:00,702 - Removed vim-common

$ apt-get install vim
...
vim is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 vim : Depends: vim-common (= 2:7.3.547-7+deb7u3) but it is not going to be 
installed
```

New unit tests for `Package` in `ambari-agent`:

```
Ran 456 tests in 38.256s

OK
```


Thanks,

Attila Doroszlai

Reply via email to