opensvc
13 days agoMerge pull request #50 from cvaroqui/master master
Christophe Varoqui [Sun, 9 Feb 2020 02:48:40 +0000 (03:48 +0100)]
Merge pull request #50 from cvaroqui/master

Don't start/stop task.type=oci containers on start/stop

13 days agoDon't start/stop task.type=oci containers on start/stop
Christophe Varoqui [Sun, 9 Feb 2020 02:38:59 +0000 (03:38 +0100)]
Don't start/stop task.type=oci containers on start/stop

Use the resTask start/stop method instead of the resContainer implementation.

As the resTaskDocker class inherits from the resTask and the resContainerDocker
driver, explicitely choose the start/stop implementation to use.

2 weeks agoClassify "enter" as a no-lock action
Christophe Varoqui [Sat, 8 Feb 2020 09:14:06 +0000 (10:14 +0100)]
Classify "enter" as a no-lock action

So multiple enter can run in parallel.

2 weeks agoMerge pull request #48 from cvaroqui/master
Christophe Varoqui [Sat, 8 Feb 2020 06:37:39 +0000 (07:37 +0100)]
Merge pull request #48 from cvaroqui/master

Fix a monitor thread stack triggered when a lot of objects are being …

2 weeks agoAdd the "enter --rid <rid>" action
Christophe Varoqui [Sat, 8 Feb 2020 06:26:34 +0000 (07:26 +0100)]
Add the "enter --rid <rid>" action

Implement for docker and podman first.
Detect a shell in the container and execute interactively with a tty.
This action avoids having to use "oci exec -it {n} bash" syntax.

Also add a GET /object_enter api handler, launching a singe-use gotty server,
with random creds, random port and random path. A browser has then a few
seconds to connect before it dies.

2 weeks agoFix a monitor thread stack triggered when a lot of objects are being deleted
Christophe Varoqui [Fri, 7 Feb 2020 08:20:18 +0000 (09:20 +0100)]
Fix a monitor thread stack triggered when a lot of objects are being deleted

Traceback (most recent call last):
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 151, in run
    self.do()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 223, in do
    self.orchestrator()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 785, in orchestrator
    self.sync_services_conf()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 237, in sync_services_conf
    confs = self.get_services_configs()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 2706, in get_services_configs
    for path, config in configs.items():
RuntimeError: dictionary changed size during iteration

2 weeks agoMerge pull request #47 from cvaroqui/master
Christophe Varoqui [Wed, 5 Feb 2020 14:33:17 +0000 (15:33 +0100)]
Merge pull request #47 from cvaroqui/master

Fix an issue in event delivery to clients

2 weeks agoFix an issue in event delivery to clients
Christophe Varoqui [Wed, 5 Feb 2020 14:24:49 +0000 (15:24 +0100)]
Fix an issue in event delivery to clients

In a fast succession of events, a n+1 event could overwrite the n event data
for a client.

Make a copy of the dequeue event before putting the copy in the client queue,
to avoid being replaced while queued.

2 weeks agoMerge pull request #46 from cvaroqui/master
Christophe Varoqui [Wed, 5 Feb 2020 08:41:11 +0000 (09:41 +0100)]
Merge pull request #46 from cvaroqui/master

Allow forwarding to the opensvc backend networks

2 weeks agoAllow forwarding to the opensvc backend networks
Christophe Varoqui [Wed, 5 Feb 2020 08:33:16 +0000 (09:33 +0100)]
Allow forwarding to the opensvc backend networks

docker setting the FORWARD chain default policy to DROP, we need to allow
opensvc backend networks.

Use the following pair of rules per net:

-A FORWARD -i obr_net1 -m comment --comment "name: net1" -j ACCEPT
-A FORWARD -o obr_net1 -m comment --comment "name: net1" -j ACCEPT

2 weeks agoMerge pull request #45 from cgalibern/master
cgalibern [Tue, 4 Feb 2020 18:15:32 +0000 (19:15 +0100)]
Merge pull request #45 from cgalibern/master

Improve tests & small refacto on lock lib

2 weeks agoAdd opensvc.iml to git ignored files
Cyril Galibern [Tue, 4 Feb 2020 16:37:13 +0000 (17:37 +0100)]
Add opensvc.iml to git ignored files

2 weeks agoFix lock creation failure when lock directory doesn't exist
Cyril Galibern [Tue, 4 Feb 2020 16:32:50 +0000 (17:32 +0100)]
Fix lock creation failure when lock directory doesn't exist

2 weeks agoApply pep8 style to lock.py
Cyril Galibern [Tue, 4 Feb 2020 16:01:06 +0000 (17:01 +0100)]
Apply pep8 style to lock.py

2 weeks agoTests: tests lock lib
Cyril Galibern [Tue, 4 Feb 2020 15:59:35 +0000 (16:59 +0100)]
Tests: tests lock lib

o lib/tests/test_lock.py:
 o TestLockUnlock::test_lock_unlock[0]
 o TestLockUnlock::test_lock_unlock[1]
 o TestLockUnlock::test_lock_unlock[2]
 o TestLockUnlock::test_lock_unlock[3]
 o TestLockUnlock::test_lock_unlock[4]
 o TestLockUnlock::test_lock_unlock[5]
 o TestLockUnlock::test_lock_unlock[6]
 o TestLockUnlock::test_lock_unlock[7]
 o TestLockUnlock::test_lock_unlock[8]
 o TestLockUnlock::test_lock_unlock[9]
 o TestLockUnlock::test_can_lock_again[0]
 o TestLockUnlock::test_can_lock_again[1]
 o TestLockUnlock::test_can_lock_again[2]
 o TestLockUnlock::test_can_lock_again[3]
 o TestLockUnlock::test_can_lock_again[4]
 o TestLockUnlock::test_can_lock_again[5]
 o TestLockUnlock::test_can_lock_again[6]
 o TestLockUnlock::test_can_lock_again[7]
 o TestLockUnlock::test_can_lock_again[8]
 o TestLockUnlock::test_can_lock_again[9]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[0]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[1]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[2]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[3]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[4]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[5]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[6]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[7]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[8]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[9]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[0]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[1]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[2]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[3]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[4]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[5]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[6]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[7]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[8]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[9]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[0]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[1]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[2]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[3]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[4]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[5]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[6]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[7]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[8]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[9]
 o TestCmlock::test_no_run_x_acquired_fails[0]
 o TestCmlock::test_no_run_x_acquired_fails[1]
 o TestCmlock::test_no_run_x_acquired_fails[2]
 o TestCmlock::test_no_run_x_acquired_fails[3]
 o TestCmlock::test_no_run_x_acquired_fails[4]
 o TestCmlock::test_no_run_x_acquired_fails[5]
 o TestCmlock::test_no_run_x_acquired_fails[6]
 o TestCmlock::test_no_run_x_acquired_fails[7]
 o TestCmlock::test_no_run_x_acquired_fails[8]
 o TestCmlock::test_no_run_x_acquired_fails[9]
 o TestLockExceptions::test_timeout_exc
 o TestLockExceptions::test_acquire_exc

2 weeks agoTest: refacto mgr tests
Cyril Galibern [Tue, 4 Feb 2020 12:48:37 +0000 (13:48 +0100)]
Test: refacto mgr tests

2 weeks agoTests: tests config with lvm service
Cyril Galibern [Tue, 4 Feb 2020 12:47:30 +0000 (13:47 +0100)]
Tests: tests config with lvm service

o lib/tests/test_svc.py::TestSvcWithDiskLvm
  o has disk vg resource
  o disk resource is optional by default
  o has no disk pr resource
  o disk resource set optional from config
  o automatic define disk pr
  o disk pr is non optional by default
  o disk pr set optional from config

2 weeks agoMerge pull request #44 from cvaroqui/master
Christophe Varoqui [Tue, 4 Feb 2020 04:26:35 +0000 (05:26 +0100)]
Merge pull request #44 from cvaroqui/master

Redirect "om <secpath> ed" to edit config

2 weeks agoRedirect "om <secpath> ed" to edit config
Christophe Varoqui [Tue, 4 Feb 2020 04:17:09 +0000 (05:17 +0100)]
Redirect "om <secpath> ed" to edit config

The "ed" action is now entering the Data::edit() codepath, which fail because
no key is set in options.

Instead of failing, redirect to Data::edit_config(), which is the codepath
that was entered before the "edit --key <k>" action was added.

2 weeks agoMerge pull request #43 from cvaroqui/master
Christophe Varoqui [Mon, 3 Feb 2020 01:37:38 +0000 (02:37 +0100)]
Merge pull request #43 from cvaroqui/master

2 fixes for print status displayed information

2 weeks agoUse a more coherent display name for parents and children in print status output
Christophe Varoqui [Mon, 3 Feb 2020 01:30:06 +0000 (02:30 +0100)]
Use a more coherent display name for parents and children in print status output

Use fully qualified svcpath if no namespace is locked, else use the stripped
svcpath.

2 weeks agoFix "undef" status of parents in print status output
Christophe Varoqui [Mon, 3 Feb 2020 01:06:45 +0000 (02:06 +0100)]
Fix "undef" status of parents in print status output

This issue happens when a parent is defined as a short svcname, implicitely
relative to the child namespace.

Use resolve_path() on defined parents when adding them to the selector used
to fetch monitor data.

2 weeks agoMerge pull request #42 from cvaroqui/master
Christophe Varoqui [Sun, 2 Feb 2020 06:36:54 +0000 (07:36 +0100)]
Merge pull request #42 from cvaroqui/master

Fix "om mon" showing out of current namespace objects

2 weeks agoFix "om mon" showing out of current namespace objects
Christophe Varoqui [Sun, 2 Feb 2020 06:21:16 +0000 (07:21 +0100)]
Fix "om mon" showing out of current namespace objects

The "daemon_status" and "events" api handlers accept the namespace option,
but "om mon" did not set this option.

This patch adds the namespace kwarg to the Node::_daemon_status() and Node::
daemon_events() methods, and use that new kwarg in calls from svcmon.

3 weeks agoMerge pull request #37 from cgalibern/master
cgalibern [Sat, 1 Feb 2020 09:22:37 +0000 (10:22 +0100)]
Merge pull request #37 from cgalibern/master

Improve tests & implement fs.flag resource driver for SunOS

3 weeks agoTest: run pytest before pylint to have earlier failure status
Cyril Galibern [Sat, 1 Feb 2020 09:17:30 +0000 (10:17 +0100)]
Test: run pytest before pylint to have earlier failure status

3 weeks agoSet can_rollback on successful start in the fs.flag driver
Cyril Galibern [Sat, 1 Feb 2020 09:13:01 +0000 (10:13 +0100)]
Set can_rollback on successful start in the fs.flag driver

pickup from commit; a79c01ac27d16e414eaf50210682d28cbf8fdd8b

3 weeks agoAdd fs.flag resource driver for SunOS
Cyril Galibern [Fri, 31 Jan 2020 19:17:01 +0000 (20:17 +0100)]
Add fs.flag resource driver for SunOS

3 weeks agoReformat mgr.py
Cyril Galibern [Fri, 31 Jan 2020 17:32:28 +0000 (18:32 +0100)]
Reformat mgr.py

3 weeks agoAdd service actions (Tests)
Cyril Galibern [Fri, 31 Jan 2020 17:22:10 +0000 (18:22 +0100)]
Add service actions (Tests)

Service tests are done on Linux, SunOS, Darwin, FreeBSD, HP-UX, OSF1

Resource fs with type 'flag' only tested on Linux

collected 31 items
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionFsFlagWithPriv::test_create_service_with_fs_flag_then_verify_config[Linux] PASSED

3 weeks agoTests: use capture_stdout fixture
Cyril Galibern [Fri, 31 Jan 2020 16:41:28 +0000 (17:41 +0100)]
Tests: use capture_stdout fixture

3 weeks agoTest Linux fs driver honoring the "umount fs with io err" policy
Cyril Galibern [Tue, 28 Jan 2020 21:39:04 +0000 (22:39 +0100)]
Test Linux fs driver honoring the "umount fs with io err" policy

3 weeks agoMerge pull request #41 from cvaroqui/master
Christophe Varoqui [Sat, 1 Feb 2020 04:48:54 +0000 (05:48 +0100)]
Merge pull request #41 from cvaroqui/master

Fix the cfg objects add --from <dir> path walking algorithm

3 weeks agoFix the cfg objects add --from <dir> path walking algorithm
Christophe Varoqui [Sat, 1 Feb 2020 04:41:51 +0000 (05:41 +0100)]
Fix the cfg objects add --from <dir> path walking algorithm

os.walk() already recurse subdirs for us, no need to recurse ourselves.

3 weeks agoMerge pull request #40 from cvaroqui/master
Christophe Varoqui [Sat, 1 Feb 2020 01:59:49 +0000 (02:59 +0100)]
Merge pull request #40 from cvaroqui/master

Two small fixes

3 weeks agoFix Svc::resource_handling_dir() stacking on fs drivers with no mount_point
Christophe Varoqui [Sat, 1 Feb 2020 01:46:14 +0000 (02:46 +0100)]
Fix Svc::resource_handling_dir() stacking on fs drivers with no mount_point

The linux loop driver calls that in its status() codepath, and stacks if
the service has a fs.flag resource, which has no mount_point attribute.

3 weeks agoSet can_rollback on succesful start in the fs.flag driver
Christophe Varoqui [Fri, 31 Jan 2020 08:02:26 +0000 (09:02 +0100)]
Set can_rollback on succesful start in the fs.flag driver

3 weeks agoMerge pull request #39 from cvaroqui/master
Christophe Varoqui [Fri, 31 Jan 2020 07:29:09 +0000 (08:29 +0100)]
Merge pull request #39 from cvaroqui/master

Fix the cluster.vip scoped declaration

3 weeks agoFix the cluster.vip scoped declaration
Christophe Varoqui [Fri, 31 Jan 2020 07:21:17 +0000 (08:21 +0100)]
Fix the cluster.vip scoped declaration

Which did not translate into a proper ipdev scoping in system/svc/vip

3 weeks agoMerge pull request #38 from cvaroqui/master
Christophe Varoqui [Fri, 31 Jan 2020 06:36:19 +0000 (07:36 +0100)]
Merge pull request #38 from cvaroqui/master

Misc enhancements and fixes

3 weeks agoAdd the "edit --key <k>" action to sec and cfg objects
Christophe Varoqui [Fri, 31 Jan 2020 06:01:25 +0000 (07:01 +0100)]
Add the "edit --key <k>" action to sec and cfg objects

So users can easily edit text keys (like config files) stored as keys in
these objects.

3 weeks agoAdd a fullpem key to the sec object on "gen cert" action
Christophe Varoqui [Fri, 31 Jan 2020 05:21:01 +0000 (06:21 +0100)]
Add a fullpem key to the sec object on "gen cert" action

Some programs, like haproxy, expect fullpems to be installed (ex:
/etc/haproxy/ssl/).

Adding this new key allows to project the fullpem to a volume and bind mount
it in containers via "volume_mounts".

3 weeks agoSupport more container image formats
Christophe Varoqui [Fri, 31 Jan 2020 01:00:34 +0000 (02:00 +0100)]
Support more container image formats

rcContainer::get_image() did not support the following formats

* repo:port/a/b:latest
* repo:port/a/b

... as it considered everything after the first ":" is the tagname.

3 weeks agoMerge pull request #36 from cgalibern/master
cgalibern [Mon, 27 Jan 2020 15:29:12 +0000 (16:29 +0100)]
Merge pull request #36 from cgalibern/master

Disable patch coverage

3 weeks agoDisable patch coverage
Cyril Galibern [Mon, 27 Jan 2020 15:20:53 +0000 (16:20 +0100)]
Disable patch coverage

3 weeks agoMerge pull request #35 from cvaroqui/master
Christophe Varoqui [Mon, 27 Jan 2020 15:07:20 +0000 (16:07 +0100)]
Merge pull request #35 from cvaroqui/master

Zone driver janitoring and fix fs driver stop for fs with io errors

3 weeks agoFix fs driver not honoring the "umount fs with io err" policy
Christophe Varoqui [Mon, 27 Jan 2020 14:23:52 +0000 (15:23 +0100)]
Fix fs driver not honoring the "umount fs with io err" policy

Wrong errno test.

3 weeks agoAllow the prkey keyword on fs resources
Christophe Varoqui [Mon, 27 Jan 2020 14:04:45 +0000 (15:04 +0100)]
Allow the prkey keyword on fs resources

Like it is allowed on disk resources. This 'prkey' keyword
must be allowed on every resource allowing 'scsiresev'.

3 weeks agoUpdate docs for a volume_mounts keyword help update
Christophe Varoqui [Mon, 27 Jan 2020 14:04:03 +0000 (15:04 +0100)]
Update docs for a volume_mounts keyword help update

3 weeks agoApply coding style to the solaris zone container driver
Christophe Varoqui [Mon, 27 Jan 2020 10:38:55 +0000 (11:38 +0100)]
Apply coding style to the solaris zone container driver

3 weeks agoMerge pull request #34 from cgalibern/master
cgalibern [Mon, 27 Jan 2020 12:39:12 +0000 (13:39 +0100)]
Merge pull request #34 from cgalibern/master

Tests: re-add some nodemgr tests

3 weeks agoTests: re-add some nodemgr tests
Cyril Galibern [Sun, 26 Jan 2020 21:11:08 +0000 (22:11 +0100)]
Tests: re-add some nodemgr tests

3 weeks agoDo not try to halt a zone in 'unavailable' state
Christophe Varoqui [Mon, 27 Jan 2020 09:17:32 +0000 (10:17 +0100)]
Do not try to halt a zone in 'unavailable' state

3 weeks agoFix the fs.flag resource for services in the root namespace
Christophe Varoqui [Sun, 26 Jan 2020 15:47:22 +0000 (16:47 +0100)]
Fix the fs.flag resource for services in the root namespace

The flag path formatter expected the namespace to be set.

3 weeks agoFix the sym array actions
Christophe Varoqui [Sun, 26 Jan 2020 12:50:16 +0000 (13:50 +0100)]
Fix the sym array actions

Using a non existent Node::logger attribute.
Causing:

Traceback (most recent call last):
  File "/usr/share/opensvc/lib/nodemgr.py", line 113, in <module>
    ret = main()
  File "/usr/share/opensvc/lib/nodemgr.py", line 102, in main
    return _main(node, argv=argv)
  File "/usr/share/opensvc/lib/nodemgr.py", line 82, in _main
    err = node.action(action)
  File "/usr/share/opensvc/lib/node.py", line 1076, in action
    return self._action(action, options)
  File "/usr/share/opensvc/lib/rcScheduler.py", line 114, in _func
    ret = func(self, action, options)
  File "/usr/share/opensvc/lib/node.py", line 1106, in _action
    ret = getattr(self, action)()
  File "/usr/share/opensvc/lib/node.py", line 2256, in array
    return mod.main(self.options.extra_argv, node=self)
  File "/usr/share/opensvc/lib/rcSymmetrix.py", line 1455, in main
    do_action(action, node=node, **kwargs)
  File "/usr/share/opensvc/lib/rcSymmetrix.py", line 1442, in do_action
    node.logger.handlers[1].setLevel(logging.CRITICAL)
AttributeError: 'Node' object has no attribute 'logger'

4 weeks agoPython3.8 support
Christophe Varoqui [Fri, 24 Jan 2020 23:16:04 +0000 (00:16 +0100)]
Python3.8 support

Fix all 'SyntaxWarning: "is" with a literal.' errors.

4 weeks agoMerge pull request #32 from cgalibern/master
Christophe Varoqui [Fri, 24 Jan 2020 16:57:01 +0000 (17:57 +0100)]
Merge pull request #32 from cgalibern/master

Use pytest instead of nose

4 weeks agoTests: replace nose by pytest
Cyril Galibern [Fri, 24 Jan 2020 16:38:23 +0000 (17:38 +0100)]
Tests: replace nose by pytest

4 weeks agoTests: nose->pytest for test_ci_converters.py
Cyril Galibern [Fri, 24 Jan 2020 16:32:53 +0000 (17:32 +0100)]
Tests: nose->pytest for test_ci_converters.py

4 weeks agoTests: nose->pytest for test_ci_storage.py
Cyril Galibern [Fri, 24 Jan 2020 16:03:07 +0000 (17:03 +0100)]
Tests: nose->pytest for test_ci_storage.py

4 weeks agoTests: nose->pytest for test_ci_rcstatus.py
Cyril Galibern [Fri, 24 Jan 2020 15:54:27 +0000 (16:54 +0100)]
Tests: nose->pytest for test_ci_rcstatus.py

4 weeks agoTests: nose->pytest for test_import.py
Cyril Galibern [Fri, 24 Jan 2020 15:44:19 +0000 (16:44 +0100)]
Tests: nose->pytest for test_import.py

4 weeks agoTests: nose->pytest for freezer.py
Cyril Galibern [Fri, 24 Jan 2020 15:33:31 +0000 (16:33 +0100)]
Tests: nose->pytest for freezer.py

4 weeks agoTests: prepare nose->pytest for freezer.py
Cyril Galibern [Fri, 24 Jan 2020 13:54:40 +0000 (14:54 +0100)]
Tests: prepare nose->pytest for freezer.py

4 weeks agoTests: nose->pytest for forest.py
Cyril Galibern [Fri, 24 Jan 2020 13:53:24 +0000 (14:53 +0100)]
Tests: nose->pytest for forest.py

4 weeks agoTests: prepare nose->pytest for forest.py
Cyril Galibern [Fri, 24 Jan 2020 13:46:54 +0000 (14:46 +0100)]
Tests: prepare nose->pytest for forest.py

4 weeks agoDiscard 127.0.1.1 as a ipip tunnel endpoint
Christophe Varoqui [Fri, 24 Jan 2020 13:46:14 +0000 (14:46 +0100)]
Discard 127.0.1.1 as a ipip tunnel endpoint

We already discarded 127.0.0.1, discard 127.0.1.1 too.

So we have a chance to guess a correct routable ip to configure as the
local tunnel endpoint.

4 weeks agoTests: Remove unused future import
Cyril Galibern [Fri, 24 Jan 2020 12:13:21 +0000 (13:13 +0100)]
Tests: Remove unused future import

4 weeks agoTests: pytest ignore external lib warnings
Cyril Galibern [Thu, 23 Jan 2020 10:51:31 +0000 (11:51 +0100)]
Tests: pytest ignore external lib warnings

4 weeks agoRemove some invalid escape sequence in string
Cyril Galibern [Thu, 23 Jan 2020 10:50:33 +0000 (11:50 +0100)]
Remove some invalid escape sequence in string

4 weeks agoTests use updated sys.path from conftest.py
Cyril Galibern [Thu, 23 Jan 2020 10:47:08 +0000 (11:47 +0100)]
Tests use updated sys.path from conftest.py

4 weeks agoUse code coverage from pytest
Cyril Galibern [Thu, 23 Jan 2020 10:45:15 +0000 (11:45 +0100)]
Use code coverage from pytest

4 weeks agoFix invalid escape sequence warnings
Cyril Galibern [Fri, 24 Jan 2020 11:30:25 +0000 (12:30 +0100)]
Fix invalid escape sequence warnings

4 weeks agoFix Default argument value is mutable
Cyril Galibern [Fri, 24 Jan 2020 11:33:34 +0000 (12:33 +0100)]
Fix Default argument value is mutable

4 weeks agoUpdate rcUtilities.py with pep8 style
Cyril Galibern [Thu, 23 Jan 2020 13:34:05 +0000 (14:34 +0100)]
Update rcUtilities.py with pep8 style

4 weeks agoFix dump_config_data() trying to replace in non-string values
Christophe Varoqui [Fri, 24 Jan 2020 09:39:55 +0000 (10:39 +0100)]
Fix dump_config_data() trying to replace in non-string values

4 weeks agoDon't allow dumping "some_kw=None" in configs
Christophe Varoqui [Fri, 24 Jan 2020 09:33:26 +0000 (10:33 +0100)]
Don't allow dumping "some_kw=None" in configs

Skip when the value is None.

4 weeks agoFix cloning of an object config with line continuations
Christophe Varoqui [Fri, 24 Jan 2020 09:23:55 +0000 (10:23 +0100)]
Fix cloning of an object config with line continuations

After "om svc2 create --config svc1" the indentation of line continuation
in svc2 was suppressed, making the lines seen as keywords.

4 weeks agoMerge pull request #29 from cgalibern/master
Christophe Varoqui [Thu, 23 Jan 2020 09:53:16 +0000 (10:53 +0100)]
Merge pull request #29 from cgalibern/master

Ensure error on dup docker mount destinations

4 weeks agoMove test_ci_utilities.py from nose to pytest
Cyril Galibern [Thu, 23 Jan 2020 09:33:19 +0000 (10:33 +0100)]
Move test_ci_utilities.py from nose to pytest

4 weeks agoAllow run tests on Darwin
Cyril Galibern [Wed, 22 Jan 2020 17:27:36 +0000 (18:27 +0100)]
Allow run tests on Darwin

4 weeks agoAllow import rcUtilitiesLinux on non Linux host
Cyril Galibern [Wed, 22 Jan 2020 16:58:15 +0000 (17:58 +0100)]
Allow import rcUtilitiesLinux on non Linux host

4 weeks agoEnsure error on dup docker mount destinations
Cyril Galibern [Wed, 22 Jan 2020 16:54:50 +0000 (17:54 +0100)]
Ensure error on dup docker mount destinations

This is done when source of volume_mount is a volume or a directory.

4 weeks agoRemove the mount point existence test in stop() of the fs linux driver
Christophe Varoqui [Wed, 22 Jan 2020 14:56:02 +0000 (15:56 +0100)]
Remove the mount point existence test in stop() of the fs linux driver

If the fs becomes unavailable, the stat() of the mount point
would fail, but we must try to umount anyway on stop.

4 weeks agoFix a log message reporting a volume status as integer
Christophe Varoqui [Wed, 22 Jan 2020 10:06:44 +0000 (11:06 +0100)]
Fix a log message reporting a volume status as integer

4 weeks agoMerge branch 'master' of github.com:opensvc/opensvc
Cyril Galibern [Wed, 22 Jan 2020 09:59:55 +0000 (10:59 +0100)]
Merge branch 'master' of github.com:opensvc/opensvc

4 weeks agoUpdate coverage files
Cyril Galibern [Wed, 22 Jan 2020 09:59:15 +0000 (10:59 +0100)]
Update coverage files

4 weeks agoUpdate coverage version to allow py-cov requirements
Cyril Galibern [Wed, 22 Jan 2020 09:59:00 +0000 (10:59 +0100)]
Update coverage version to allow py-cov requirements

4 weeks agoDo not dedup on "set --kw <kw>+=<val>", add "set --kw <kw>|=<val>"
Christophe Varoqui [Wed, 22 Jan 2020 09:26:29 +0000 (10:26 +0100)]
Do not dedup on "set --kw <kw>+=<val>", add "set --kw <kw>|=<val>"

The |= operator enters the dedup code, explicitely.

Shlex expression and lists should allow duplicate entries, so better to
let the user choose between a dedup'ed and non-dedup'ed methods.

4 weeks agoMerge branch 'test-dup-dest-in-containter-mounts' into 'master'
Galibern [Wed, 22 Jan 2020 09:10:16 +0000 (09:10 +0000)]
Merge branch 'test-dup-dest-in-containter-mounts' into 'master'

Test dup dest in containter mounts

See merge request opensvc/opensvc!3

4 weeks agoAdd python 2.7 to gitlab-ci tests, add pytest cov
Cyril Galibern [Tue, 21 Jan 2020 23:06:48 +0000 (00:06 +0100)]
Add python 2.7 to gitlab-ci tests, add pytest cov

4 weeks agoEnsure raise an error if volume_mounts contains dup dst mount points
Cyril Galibern [Tue, 21 Jan 2020 19:23:21 +0000 (20:23 +0100)]
Ensure raise an error if volume_mounts contains dup dst mount points

As docker reports a useless error (container init exited prematurely),
inform the user from opensvc.

4 weeks agoBetter dedup on "set 'foo+=a b'"
Christophe Varoqui [Tue, 21 Jan 2020 16:06:56 +0000 (17:06 +0100)]
Better dedup on "set 'foo+=a b'"

If foo has a 'a' value, this action would not detect 'a' as a duplicate, and
the final value would be 'a a b'.

This patch makes sure the end result is 'a b'.

4 weeks agoRaise an error if volume_mounts contains dup dst mount points
Christophe Varoqui [Tue, 21 Jan 2020 16:05:09 +0000 (17:05 +0100)]
Raise an error if volume_mounts contains dup dst mount points

As docker reports a useless error (container init exited prematurely),
inform the user from opensvc.

4 weeks agoUpdate fixture osvc_path_tests for 2.7
Cyril Galibern [Tue, 21 Jan 2020 14:08:08 +0000 (15:08 +0100)]
Update fixture osvc_path_tests for 2.7

4 weeks agoAdd tests for nodename abbreviation (for 'om mon' formatting)
Cyril Galibern [Tue, 21 Jan 2020 10:00:05 +0000 (11:00 +0100)]
Add tests for nodename abbreviation (for 'om mon' formatting)

4 weeks agoUpdate the volume_mounts keyword documentation
Cyril Galibern [Tue, 21 Jan 2020 08:58:32 +0000 (09:58 +0100)]
Update the volume_mounts keyword documentation

4 weeks agoTry gitlab-ci
Cyril Galibern [Mon, 20 Jan 2020 15:09:38 +0000 (16:09 +0100)]
Try gitlab-ci

4 weeks agoReformat code
Cyril Galibern [Mon, 20 Jan 2020 15:03:51 +0000 (16:03 +0100)]
Reformat code

4 weeks agoUpdate effective container volume_mounts access to respect volume resource access
Cyril Galibern [Mon, 20 Jan 2020 14:44:30 +0000 (15:44 +0100)]
Update effective container volume_mounts access to respect volume resource access

Examples on a Container resource:
o volume_mount access rw from rox volume => effective access ro
o volume_mount access ro from rwx volume => effective access ro