Commit Graph

37 Commits

Author SHA1 Message Date
Lisa Zangrando 40b56dd689 Shell version updated
This commit updates the Synergy shell version to 1.5.3

Change-Id: I4bee786179d6fc9a41b5fc50f445e3e3b00a9e74
Sem-Ver: bugfix
2017-09-12 12:48:13 +02:00
Lisa Zangrando 51e6dde4e5 Fixes on the authorization mechanism
This commit fixes some errors introduced with the support for the
authorization in Synergy. The files involved are: service.py and
shell.py and related unit tests.

Change-Id: I84587e48927307d85b9a3f96ea49154805da7bcd
Sem-Ver: bugfix
2017-07-18 07:49:05 +00:00
Lisa Zangrando 3b568b70a0 Enhancement in handling the parameters defined in the user request
The Synergy's methods startManager() stopManager() getManagerStatus() and
executeCommand() require the parsing of the parameters included into the
user request and make some checks for the mandatory parameters.
This commit enhances this parsing and checking steps by using the Python
decorators. Moreover it simplifies the execution of the methods startManager()
stopManager() and getManagerStatus() by handling requests for only one manager
at a time.

Change-Id: Ic295ad20f03459cf3e512e795529c35bd6969ed3
Sem-Ver: bugfix
2017-05-24 14:41:25 +00:00
Lisa Zangrando b99f2078a1 Missing security support
This fix provides to Synergy a security mechanism highly configurable.
The security policies are pluggable so that it is possible to define any
kind of authorization checks.
This commit includes a very simple authorization plugin (i.e.
synergy.auth.plugin.LocalHostAuthorization) which denies any command
coming from clients having IP address different from the Synergy's one.

Bug: #1691352
Change-Id: I2535b2a3edeea5e56cd8918d01070a6f8a534c3e
Sem-Ver: bugfix
2017-05-23 12:57:50 +00:00
Lisa Zangrando a8c06a001c Synergy should never raise Exception directly
The basic Exception can be used anywhere in the code but however, no
program nor library should ever raise Exception directly: it's not
specific enough to be helpful. This fix better handles the exceptions by
removing the Exception occurencies and adding a new SynergyError type.

Bug: #1690795
Change-Id: I202e063198ee9aef7397bad9b8398c24d52b5fe1
Sem-Ver: bugfix
2017-05-17 06:21:33 +00:00
Jenkins b542db3beb Merge "manager.notify() doesn't handle the NotImplementedError exceptions" 2017-05-11 12:08:14 +00:00
Lisa Zangrando a2ba511da3 manager.notify() doesn't handle the NotImplementedError exceptions
In case a manager doesn't implement the method doOnEvent() the
NotImplementedError exception is raised. The manager.notify()
doesn't handle such exceptions and fails. This fix solves the problem.

Bug: #1690117
Change-Id: I005658c4341106b54f6757ee4dfcca08a2405605
Sem-Ver: bugfix
2017-05-11 12:24:26 +02:00
Lisa Zangrando bba3767276 The synergy.log doesn't contain all logged messages
Not all messages are logged in synergy.log (e.g. the ones logged by the
modules in synergy_scheduler_manager/common). This fix solves the problem.

Bug: 1690113
Change-Id: I861f7281a1e2cc2a49567ab97482234f834919f4
Sem-Ver: bugfix
2017-05-11 10:11:40 +00:00
Vincent Llorens 5ec5c9dc42 add some unit tests for Trust
Sem-Ver: bugfix
Change-Id: Ie4ca5c7ff5e8ae0a835650751571319ffc4a93ba
2017-02-27 08:52:27 +00:00
Vincent Llorens f31e39b9ea CLI: remove auth_token, unused vars and add tests
Remove unused variables related to token and synergy_url.

Also add some unit tests for the shell.

Change-Id: I101a77e478b95534ac04e1ae73d26fef98898a5c
Sem-Ver: bugfix
2017-02-24 10:37:21 +01:00
Vincent Llorens adf0f27de6 add some unit tests for ExecuteCommand
Sem-Ver: bugfix
Change-Id: Ia87cf70b1b120f01d0d430c5d00f2a2120ee1890
2017-02-22 16:32:46 +00:00
Vincent Llorens e500611dfc add some unit tests for the ManagerCommand class
Also make small adjustements to command help texts and removed an
unused variable.

Change-Id: Id899b561cee8301be809136ad101d4a824d7e62a
Sem-Ver: bugfix
2017-02-21 14:00:59 +00:00
Vincent Llorens 449f53f687 fix one instance of "except Exception"
Sem-Ver: bugfix
Change-Id: Ic8f557c99e32990816fe0bbc8f6fa1dbcaa8593c
2017-02-21 14:26:20 +01:00
Vincent Llorens ea955b7405 add some unit tests for HTTPCommand
Sem-Ver: bugfix
Change-Id: Ibf9d255478869126da313ab54767d3d76126b899
2017-02-20 14:03:49 +00:00
Vincent Llorens f1e951c927 fix missing elements in string formatting
Sem-Ver: bugfix
Change-Id: I70de0cd4d5c4cded7e9c3a303d178b3f03333fa6
2017-02-20 09:34:12 +00:00
Lisa Zangrando 56d28fa54b The Synergy CLI is not SSL-enabled
Added support to HTTPS connections needed for interacting with Keystone

Change-Id: I1de2a862e054ac0954c9e4a5c6666b9e6e18822f
Sem-Ver: feature
2017-01-16 12:06:21 +01:00
Luong Anh Tuan 0b2d254ff5 Replaces uuid.uuid4 with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids.We should
use that function when generating uuids for consistency.

Change-Id: I9e7d8a1fcfb3b378b2ab397a0ba932d7aac17e26
Closes-Bug: #1082248
2016-12-07 09:21:44 +00:00
Lisa Zangrando d82f0e3135 Added support for OpenStack DOMAIN to shell.py
- added new shell options:
    --os-user-domain-id, --os-ser-domain-name,
    --os-project-domain-id, --os-project-domain-name

Change-Id: Id110010a325989c3b6370647aa3cf8afebeb2657
Sem-Ver: feature
2016-11-28 20:14:14 +01:00
Vincent Llorens 30a67fac85 Clean up oslo imports
We used to put `try / except ImportError` around oslo lib imports
to support both the `oslo_lib` and `oslo.lib` name patterns.

It is now useless since the newer versions of these libs all support
the `import oslo_lib` pattern.

Tested on CentOS 7 with the OpenStack Liberty repository.
Tested on Ubuntu 14.04 with OpenStack Liberty CloudArchive repository.

Change-Id: I7a147586d7a933506df62e34424e5fc57b3ff503
Sem-Ver: bugfix
2016-11-08 11:18:01 +01:00
Vincent Llorens b75d85315c Distribute tabulate as part of Synergy
Synergy depends on the python tabulate package. However, it is not
available as a system package for both CentOS 7 and Ubuntu 14.04.

In this commit we opt for the following solution: don't mark
tabulate as a dependency when building synergy system packages,
instead we provide the tabulate package as part of Synergy.

DocImpact
Change-Id: I76018e1ba27de8ad47b59c85baad2c2d06f03398
Sem-Ver: bugfix
2016-10-27 12:17:46 +02:00
Lisa Zangrando f111158610 Added unit tests
- moved existing unit tests in synergy/tests/unit
- added new unit test: synergy/tests/unit/test_serializer.py

Change-Id: I5405570dc3cd11373d02eecf6d9c8181fb083f48
2016-10-04 10:37:08 +00:00
Lisa Zangrando bd218e0a2e Fixed destroy() method
Change-Id: If1845c3a6bc35cce57417a9b82348e6b5bce59bb
2016-10-04 10:26:47 +00:00
Lisa Zangrando 79f7a63ae1 Fixed serializer
- added support for datetime

Change-Id: I68399f3fc303e16730e56afa254a7bc4b83efdf8
2016-10-03 18:34:57 +02:00
Lisa Zangrando e01f690a86 Fixed logging for managers
Change-Id: Icca0278909a303f753ac30ff0cb0b3125f62d945
2016-09-30 10:09:37 +02:00
Lisa Zangrando 4771a6e490 Commit for fixes described in https://review.openstack.org/#/c/362762/
Change-Id: Ib4e9a43381af29b0ca1e2eee05de4a4976dd8794
2016-08-31 15:24:15 +02:00
Lisa Zangrando 3c33d51dd4 Synergy enhancements
- serializer.py: improved serialization
- manager.py: Managers are now serializable
- command.py, shell.py: improved command shell by using the 'tabulate' module
- service.py: listManagers, startManager, stopManager and getManagerStatus methods now use the Managers serialization
- requirements.txt, test-requirements.txt: 'tabulate' module dependence added
- test_synergy.py, test_manager_abstract.py: updated unit tests
- setup.cfg: changed entry points

Change-Id: I657af749aa3fcb32c27b516c2b9f836c5ba0c690
2016-08-31 11:55:45 +00:00
Lisa Zangrando 19fbb53e9b first functional test added
- test-synergy: test the main service functionality
- service.py: removed unuseful code
- TimerManager: updated execute()

Change-Id: I47e0ffa446c83369cb98cffbdebda3bc2fdbe183
2016-06-15 18:54:02 +02:00
Lisa Zangrando cbd1ccd06e :added pause() and resume() methods to the Manager class
- manager.py: added pause() and resume() methods
- service.py: ManagerRPC removed
- service.py: fixed logging (logger.propagate=False)
- service.py: used the proper HTTP Status Codes on the Synergy RESTful methods
- common/service.py: fixed sigterm_handler()

Change-Id: Ida87546587edac54c738c4fc01bf029ab4507c6a
2016-06-13 09:56:30 +02:00
Vincent Llorens ee05df7f55 add unit tests on the Manager class
We provide here 2 test suites.
The first one test the base class "Manager".
Because some of its methods are abstract, we made a second test suite
that test a simple implementation of the Manager class.

Change-Id: I2f619b752699fae0fdb45f399bdef84b6892c65e
2016-06-09 11:54:36 +02:00
Lisa Zangrando 1de615b32e logging fixed and synergy shell updated
- logging: every time a new manager is loaded, it is now added to the
  Synergy logger
- logging is configured in main()
- shell: commands list sorted
- commented code: deleted

Change-Id: I1c5261db78950e03417eb4e90e2049a2ad927cb0
2016-06-08 17:13:20 +02:00
Vincent Llorens fe8dae24a8 fixed command.Execute() and changed the logging level of service.executeCommand()
Change-Id: I8cc853c99fedb6517f9820036c41d450c26e3bf8
2016-06-03 14:54:22 +00:00
Vincent Llorens 89d379e5e7 small code cleanup w/o affecting functionalities
Change-Id: I98c3e403a0a4537afcc8553a7d2d59b791e4b26a
2016-06-02 17:38:52 +02:00
Vincent Llorens ff2db3c748 fix logging
Change-Id: Ifffa10ba607e364417df75b0dfd9d9e09df2083c
2016-06-02 13:55:38 +02:00
Vincent Llorens a56f18470f add synergy CLI
Change-Id: Ibd60ee3f448873e381126ff35a635e84971ab137
2016-05-30 17:41:21 +02:00
Lisa Zangrando 31d50774e7 manager fixed
Change-Id: I81d9a877ca824022c730f037d126e79cf7104bcf
2016-05-29 10:33:43 +02:00
Vincent Llorens 3433f08a68 fix code that prevented the package from running
Change-Id: I7ff560c533098bc412a110c313a19445d4e02100
2016-04-28 17:44:31 +02:00
Vincent Llorens c2588f9972 import project from launchpad git repo
In addition to importing the project, this commit also includes fixes
to pass PEP8 and unit tests on OpenStack CI.

Commit history that was imported from the launchpad project:

. The first commit's message is:
first Synergy implementation

. This is the 2nd commit message:

added README file

. This is the 3rd commit message:

added new logging configuration support

. This is the 4th commit message:

added new logging configuration support

. This is the 5th commit message:

Synergy repository restructured

. This is the 6th commit message:

Synergy repository restructured

. This is the 7th commit message:

TimeManager

. This is the 8th commit message:

first service implementation

. This is the 9th commit message:

package synergy.managers.scheduler removed

. This is the 10th commit message:

Keystone and MYSQL configuration removed

. This is the 11th commit message:

Clean up setup.py

- remove all directory creation, chmoding, etc. This will be handled by
  the system package.

- rename `scripts` as `bin` to follow best practices.

. This is the 12th commit message:

Fix systemd unit file

- remove all the directory creation since it will be done by the system
  package.

. This is the 13th commit message:

Move synergy source to parent directory

Follow the standard of having the source package directory at the root.

This also make it easier to work with setuptools.

. This is the 14th commit message:

Add dependencies in setup.py

. This is the 15th commit message:

Add RPM spec file for packaging

. This is the 16th commit message:

debian/ubuntu package

. This is the 17th commit message:

add oslo.log as a requirement

. This is the 18th commit message:

deb pkg: explicit naming for oslo.*

. This is the 19th commit message:

rename deb package to python-synergy-service

. This is the 20th commit message:

fix debian package configure step

. This is the 21st commit message:

remove unecessary init & upstart scripts

We will target Ubuntu >= 15.04 and EL >= 7. Both use systemd by default,
so we do not need initv and upstart scripts.

. This is the 22nd commit message:

changed license field: GPL->Apache 2

. This is the 23rd commit message:

change license to Apache 2 for rpm & deb

. This is the 24th commit message:

rename python package to "synergy-service"

This is the name that will be used on PyPI.

. This is the 25th commit message:

oslo_log dependence removed

. This is the 26th commit message:

remove oslo.log dependency from packaging

. This is the 27th commit message:

remove oslo package renaming

Both python-oslo-* and python-oslo.* are supported on Ubuntu >= 15.04,
but only python-oslo.* are supported on Ubuntu 14.04.

. This is the 28th commit message:

fix oslo imports for Ubuntu14.04

This concerns 2 python packages:
- oslo config
- oslo messaging

Both packages cannot be imported using their "oslo_PKG" name in Ubuntu
14.04.

These packages can be imported on both Ubuntu 14.04 and 15.04 using
"oslo.PKG".

. This is the 29th commit message:

fix manager config setup

We check for manager in the conf file using the oslo config package.

Previously, we relied on a private variable to list the managers.
However, this private variable is not present on the oslo.config
packaged shipped with ubuntu 14.04.

In this commit we change the way we list managers to be compatible with
both Ubuntu 14.04 and 15.04.

. This is the 30th commit message:

Revert "fix oslo imports for Ubuntu14.04"

This reverts commit 6ee3b4d54765993d165169a56d54efdfb2653c89.
We are going to use try/except imports to deal with oslo{.,_}PKG

. This is the 31st commit message:

use try/except imports for oslo{.,_} packages

The oslo packages are imported using "oslo.PKG" for versions < 2.0.0,
but are imported using "oslo_PKG" for versions >= 2.0.0.

We use try/except statements to try to import "oslo_PKG" first, and fail
over to "oslo.PKG".

. This is the 32nd commit message:

add packaging README

. This is the 33rd commit message:

add cleaning functions in packaging scripts

This way when a container as finished building, when can easily do a
rebuild with: docker start -a -i container_id

. This is the 34th commit message:

various fixes on packaging

- deb: postinst depends on "adduser" package
- deb: add upstart & systemv init scripts in deb package
- deb: postrm purge now removes init script
- deb: override lintian error about systemd/init script
- rpm: fix the cleaning stage
- rpm: fix /var/lib/synergy not being created and preventing systemd
  from starting the synergy service

. This is the 35th commit message:

use entry points to discover managers

Also add the TimerManager to the manager entry point.

fix centos docker builder

The .git repo would not get cleaned up after a failed build, resulting
in incapacity of starting the container again.

add base files for OpenStack CI

Most of the files were created with cookiecutter.
http://docs.openstack.org/infra/manual/creators.html#preparing-a-new-git-repository-using-cookiecutter

fix centos docker builder

The .git repo would not get cleaned up after a failed build, resulting
in incapacity of starting the container again.

fix setup.py failing to build due to pbr

rename service to "synergy"

Previously it was either "python-synergy-service" or "synergy"
depending on the platform.

Change-Id: Iebded1d0712a710d9f71913144bf82be31e6765b
2016-04-27 16:29:13 +02:00