Set pyzabbix as an optional dependency

This patch adds the zabbix extra feature and the
'update-plugin-settings' command depends on this feature.

DocImpact
Closes-Bug: #1501667
Change-Id: I7a638ca5cb7502ac9ef9f4fb6ec69529c16ce1c9
This commit is contained in:
Ilya Kharin 2015-10-14 14:05:21 +03:00
parent ce72d7f66f
commit 91eec56609
5 changed files with 12 additions and 5 deletions

View File

@ -12,7 +12,6 @@
import argparse
import logging
import pyzabbix
import re
import requests
@ -81,9 +80,9 @@ def get_zabbix_client(astute):
session.proxies = {
'http': 'http://{0}:8888'.format(node_ip)
}
import pyzabbix
client = pyzabbix.ZabbixAPI(server=url, session=session)
client.login(user=user, password=password)
return client

View File

@ -17,5 +17,3 @@ python-keystoneclient<=0.11.1 # the last version without too fresh requirements
python-fuelclient>=6.1
cliff>=1.7.0,<=1.9.0 # should already be pulled by python-fuelclient
paramiko==1.13.0
pyzabbix==0.7.3

View File

@ -24,6 +24,12 @@ classifier =
packages =
octane
# NOTE(akscram): The extras section properly handled in pbr>=1.0.0 and
# represents the extras_require parameter.
# [extras]
# zabbix =
# pyzabbix==0.7.3
[entry_points]
console_scripts =
octane = octane.app:main
@ -40,7 +46,7 @@ octane =
cleanup = octane.commands.cleanup:CleanupCommand
sync-images = octane.commands.sync_images:SyncImagesCommand
sync-images-prepare = octane.commands.sync_images:SyncImagesPrepareCommand
update-plugin-settings = octane.commands.update_plugin_settings:UpdatePluginSettingsCommand
update-plugin-settings = octane.commands.update_plugin_settings:UpdatePluginSettingsCommand [zabbix]
octane.handlers.upgrade =
controller = octane.handlers.upgrade.controller:ControllerUpgrade
compute = octane.handlers.upgrade.compute:ComputeUpgrade

View File

@ -23,4 +23,7 @@ except ImportError:
setuptools.setup(
setup_requires=['pbr'],
# NOTE(akscram): The extras_require parameter properly handled from
# setup.cfg in pbr since 1.0.0.
extras_require={'zabbix': ['pyzabbix==0.7.3']},
pbr=True)

View File

@ -2,3 +2,4 @@ hacking<0.11,>=0.10.0
pytest<2.8.0
pytest-cov
pytest-mock
pyzabbix==0.7.3