
From: Aline Manera <alinefm@br.ibm.com> Hi all, I helped Paulo to apply the suggestions made on reviews and I am resending his patches. Following are the modifications I made. V3 -> V4 - Update API.md - fix type and add the task resource will be returned when doing an update operation - Use cherrypy.expose to expose the update() handler for PackagesUpdate(Collection) - Return a task resource while performing an update operation That way UI can provide good progress messages to the user - Use apt-get command to update Ubuntu system instead of apt binding python to be able to get the output in live time. - Adjust errors messages according refactor exception patches - Expose update tool in Capabilities that way UI can disable update button when no supported tool is found. - Add tests for test_rest.py ------------------------------------------------------------------------------ This patch set provides support to host's software update operations. To test the backend (ONLY mockmodel) execute the following commands: $ cd tests $ sudo ./run_tests.sh test_mockmodel.MockModelTests.test_packages_update To test the REST API, execute the following commands (all them are agnostic of the host's distro): 1) Get list of all packages to be updated in the host: $ curl -H 'Content-type: application/json' -H 'Accept: application/json' http://localhost:8000/host/packagesupdate/ -X GET 2) Update the host system: $ curl -H 'Content-type: application/json' -H 'Accept: application/json' http://localhost:8000/host/packagesupdate/update -X POST -d '' V2 -> V3: * Fixed indent and wrong bullets on docs/API.md * Changed to use Collection and Resource * Removed unnecessary 'exposed' * PEP8 compatibility on mockmodel.py * Removed debug prints from swupdate.py * Fixed indent in swupdate.py * Usage of utils.run_command() to execute Zypper update * Updated swupdate.py and mockmodel.py to make consistent with docs/API.md * Usage of Task element in mockmodel.py * Created test case in test_mockmodel.py V1 -> V2: * rebased to use new model framework * added SLES as Zypper supported distro * PEP8 compatibility * changed import sentences * use of run_command() from utils.py to execute shell commands * usage of Task element to return update status V1: At this point, an agnostic class is providing support to backend and REST API operations. In addition, YUM (for RHEL and Fedora), APT (for Debian and Ubuntu) and ZYPPER (for OpenSuse) specific classes are provided to support the operation os each software update system. Aline Manera (2): host update: Update po files host update: Expose update tool Paulo Vital (5): Host's software update: Update API.md Host's software update: Update REST API Host's software update: Update backend. Host's software update: Update Makefile Host's software update: Update test cases. Makefile.am | 1 + docs/API.md | 35 +++++++ po/en_US.po | 29 +++++- po/kimchi.pot | 29 +++++- po/pt_BR.po | 29 +++++- po/zh_CN.po | 29 +++++- src/kimchi/Makefile.am | 1 + src/kimchi/control/host.py | 29 ++++++ src/kimchi/i18n.py | 5 + src/kimchi/mockmodel.py | 51 +++++++++ src/kimchi/model/config.py | 10 +- src/kimchi/model/host.py | 45 +++++++- src/kimchi/swupdate.py | 247 ++++++++++++++++++++++++++++++++++++++++++++ tests/test_mockmodel.py | 15 +++ tests/test_rest.py | 28 +++++ 15 files changed, 577 insertions(+), 6 deletions(-) create mode 100644 src/kimchi/swupdate.py -- 1.7.10.4