Enable some off-by-default checks
Some of the available checks are disabled by default, like: [H106] Don't put vim configuration in source files [H203] Use assertIs(Not)None to check for None [H904] Use ',' instead of '%', String interpolation should be delayed to be handled by the logging code, rather than being done at the point of the logging call. Change-Id: Ie985fcf78997a86d41e40eacbb4a5ace8592a348
|1 year ago|
|README.rst||3 years ago|
|zaqar_notification.py||1 year ago|
|zaqar_notification_example_consumer.py||3 years ago|
|zaqarclientwrapper.py||3 years ago|
Manila has feature called 'share driver hooks'. Which allows to perform actions before and after driver actions such as 'create share' or 'access allow', also allows to do custom things on periodic basis.
Here, we provide example of mount automation using this feature. This example uses OpenStack Zaqar project for sending notifications when operations 'access allow' and 'access deny' are performed. Server side hook will send notifications about changed access for shares after granting and prior to denying access.
1. Place files 'zaqarclientwrapper.py' and 'zaqar_notification.py' to dir %manila_dir%/manila/share/hooks.
Then update manila configuration file with following options:
[share_backend_config_group] hook_drivers = manila.share.hooks.zaqar_notification.ZaqarNotification enable_pre_hooks = True enable_post_hooks = True enable_periodic_hooks = False [zaqar] zaqar_auth_url = http://%ip_of_endpoint_with_keystone%:35357/v2.0/ zaqar_region_name = %name_of_region_optional% zaqar_username = foo_user zaqar_password = foo_tenant zaqar_project_name = foo_password zaqar_queues = manila_notification
1. Place files 'zaqarclientwrapper.py' and 'zaqar_notification_example_consumer.py' to any dir on user machine, but they both should be in the same dir.
[zaqar] # Consumer-related options sleep_between_consume_attempts = 7 mount_dir = "/tmp" expected_ip_addresses = 10.254.0.4 # Common options for consumer and server sides zaqar_auth_url = http://%ip_of_endpoint_with_keystone%:35357/v2.0/ zaqar_region_name = %name_of_region_optional% zaqar_username = foo_user zaqar_password = foo_tenant zaqar_project_name = foo_password zaqar_queues = manila_notification
Consumer options descriptions:
$ zaqar_notification_example_consumer.py --config-file path/to/config.conf