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/07/05 12:56:38 UTC

Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

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

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


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
-----

  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/1/


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


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

Posted by Sid Wagle <sw...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60655/#review179883
-----------------------------------------------------------


Ship it!




Ship It!

- Sid Wagle


On July 6, 2017, 6:32 a.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60655/
> -----------------------------------------------------------
> 
> (Updated July 6, 2017, 6:32 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> 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
> -----
> 
>   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/
> 
> 
> 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
> 
>


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60655/#review179887
-----------------------------------------------------------


Ship it!




Ship It!

- Jonathan Hurley


On July 6, 2017, 2:32 a.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60655/
> -----------------------------------------------------------
> 
> (Updated July 6, 2017, 2:32 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> 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
> -----
> 
>   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/
> 
> 
> 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
> 
>


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

Posted by Attila Doroszlai <ad...@hortonworks.com>.
-----------------------------------------------------------
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


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60655/#review179664
-----------------------------------------------------------




ambari-server/src/main/resources/custom_action_definitions/system_action_definitions.xml
Lines 104 (patched)
<https://reviews.apache.org/r/60655/#comment254474>

    Change to: Remove packages specified by package_list, instructing the package manager to ignore dependencies.



ambari-server/src/main/resources/custom_actions/scripts/force_remove_packages.py
Lines 46 (patched)
<https://reviews.apache.org/r/60655/#comment254475>

    Can you specify which packages failed here? Or, at least, the list of packages attempted?


- Jonathan Hurley


On July 5, 2017, 8:56 a.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60655/
> -----------------------------------------------------------
> 
> (Updated July 5, 2017, 8:56 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> 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
> -----
> 
>   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/1/
> 
> 
> 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
> 
>


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

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

> On July 5, 2017, 7:42 p.m., Jonathan Hurley wrote:
> > ambari-common/src/main/python/resource_management/core/providers/package/apt.py
> > Line 106 (original), 107 (patched)
> > <https://reviews.apache.org/r/60655/diff/1/?file=1769537#file1769537line107>
> >
> >     For clarity, can we change this naming convention from "with" to "ignore". Using "with" makes it seem like you're also removing dependencies. A simple ignore_dependencies=False would be good.

In case of `with_deps = True`, the package manager in fact was removing dependencies, so that was correct.  Anyway I changed it to `ignore_dependencies` for clarity.


- Attila


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


On July 6, 2017, 8:32 a.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> 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.
> 
> 
> 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
> -----
> 
>   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/
> 
> 
> 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
> 
>


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60655/#review179663
-----------------------------------------------------------




ambari-common/src/main/python/resource_management/core/providers/package/apt.py
Line 106 (original), 107 (patched)
<https://reviews.apache.org/r/60655/#comment254472>

    For clarity, can we change this naming convention from "with" to "ignore". Using "with" makes it seem like you're also removing dependencies. A simple ignore_dependencies=False would be good.


- Jonathan Hurley


On July 5, 2017, 8:56 a.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60655/
> -----------------------------------------------------------
> 
> (Updated July 5, 2017, 8:56 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> 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
> -----
> 
>   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/1/
> 
> 
> 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
> 
>


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

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

> On júl. 5, 2017, 8:11 du, Alejandro Fernandez wrote:
> > ambari-server/src/main/resources/custom_actions/scripts/force_remove_packages.py
> > Lines 41 (patched)
> > <https://reviews.apache.org/r/60655/diff/1/?file=1769543#file1769543line41>
> >
> >     Is this initialized to an empty list?

Yes, it is.


- Attila


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


On júl. 5, 2017, 2:56 du, Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60655/
> -----------------------------------------------------------
> 
> (Updated júl. 5, 2017, 2:56 du)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> 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
> -----
> 
>   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/1/
> 
> 
> 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
> 
>


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

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




ambari-server/src/main/resources/custom_actions/scripts/force_remove_packages.py
Lines 41 (patched)
<https://reviews.apache.org/r/60655/#comment254480>

    Is this initialized to an empty list?


- Alejandro Fernandez


On July 5, 2017, 12:56 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60655/
> -----------------------------------------------------------
> 
> (Updated July 5, 2017, 12:56 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> 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
> -----
> 
>   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/1/
> 
> 
> 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
> 
>


Re: Review Request 60655: AMBARI-21405. Create custom action to force-remove packages

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


Fix it, then Ship it!





ambari-server/src/main/resources/custom_actions/scripts/force_remove_packages.py
Lines 27 (patched)
<https://reviews.apache.org/r/60655/#comment254462>

    Add some documentation for how this is supposed to be used.


- Alejandro Fernandez


On July 5, 2017, 12:56 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60655/
> -----------------------------------------------------------
> 
> (Updated July 5, 2017, 12:56 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> 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
> -----
> 
>   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/1/
> 
> 
> 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
> 
>