ceph-manager: fix tox issues
Fix pep8 issues and remove py27 section because there is no test defined. Depends-On: I7c6bff4d8986c1fd75c3c9d353557c5eafcdcde0 Change-Id: I7b534e31868e53ec479c2321d6883604c12aa6d3 Signed-off-by: Daniel Badea <daniel.badea@windriver.com>
This commit is contained in:
parent
ac35cc5dc9
commit
d45193bf25
@ -48,7 +48,8 @@ class HandleUpgradesMixin(object):
|
||||
and state != constants.UPGRADE_COMPLETED
|
||||
and from_version == constants.TITANIUM_SERVER_VERSION_18_03):
|
||||
|
||||
LOG.info(_LI("Wait for ceph upgrade to complete before monitoring cluster."))
|
||||
LOG.info(_LI("Wait for ceph upgrade to complete "
|
||||
"before monitoring cluster."))
|
||||
self.wait_for_upgrade_complete = True
|
||||
|
||||
def set_flag_require_jewel_osds(self):
|
||||
@ -90,7 +91,8 @@ class HandleUpgradesMixin(object):
|
||||
reason = reason.strip()
|
||||
if len(reason) == 0:
|
||||
continue
|
||||
if constants.CEPH_HEALTH_WARN_REQUIRE_JEWEL_OSDS_NOT_SET in reason:
|
||||
if constants.CEPH_HEALTH_WARN_REQUIRE_JEWEL_OSDS_NOT_SET \
|
||||
in reason:
|
||||
continue
|
||||
reasons_list.append(reason)
|
||||
if len(reasons_list) == 0:
|
||||
@ -168,8 +170,9 @@ class Monitor(HandleUpgradesMixin):
|
||||
try:
|
||||
self.ceph_get_fsid()
|
||||
except Exception:
|
||||
LOG.exception("Error getting fsid, "
|
||||
"will retry in %ss" % constants.CEPH_HEALTH_CHECK_INTERVAL)
|
||||
LOG.exception(
|
||||
"Error getting fsid, will retry in %ss"
|
||||
% constants.CEPH_HEALTH_CHECK_INTERVAL)
|
||||
if self.service.entity_instance_id:
|
||||
break
|
||||
time.sleep(constants.CEPH_HEALTH_CHECK_INTERVAL)
|
||||
@ -180,8 +183,10 @@ class Monitor(HandleUpgradesMixin):
|
||||
self.ceph_poll_status()
|
||||
self.ceph_poll_quotas()
|
||||
except Exception:
|
||||
LOG.exception("Error running periodic monitoring of ceph status, "
|
||||
"will retry in %ss" % constants.CEPH_HEALTH_CHECK_INTERVAL)
|
||||
LOG.exception(
|
||||
"Error running periodic monitoring of ceph status, "
|
||||
"will retry in %ss"
|
||||
% constants.CEPH_HEALTH_CHECK_INTERVAL)
|
||||
time.sleep(constants.CEPH_HEALTH_CHECK_INTERVAL)
|
||||
|
||||
def ceph_get_fsid(self):
|
||||
@ -705,7 +710,8 @@ class Monitor(HandleUpgradesMixin):
|
||||
|
||||
return (
|
||||
msg['head'] +
|
||||
(health['health'] + lbracket + parsed_reasons_text)[:max_size - 1] +
|
||||
(health['health'] + lbracket
|
||||
+ parsed_reasons_text)[:max_size - 1] +
|
||||
rbracket + msg['tail'])
|
||||
|
||||
def _report_fault(self, health, alarm_id):
|
||||
|
@ -24,14 +24,11 @@ from oslo_log import log as logging
|
||||
from oslo_service import service
|
||||
# noinspection PyUnresolvedReferences
|
||||
from oslo_service.periodic_task import PeriodicTasks
|
||||
# noinspection PyUnresolvedReferences
|
||||
from oslo_service import loopingcall
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from cephclient import wrapper
|
||||
|
||||
from ceph_manager.monitor import Monitor
|
||||
from ceph_manager import exception
|
||||
from ceph_manager import constants
|
||||
|
||||
from ceph_manager.i18n import _LI
|
||||
|
@ -10,17 +10,12 @@ toxworkdir = /tmp/{env:USER}_ceph_manager_tox
|
||||
[testenv]
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
usedevelop = True
|
||||
install_command = pip install --no-use-wheel -U --force-reinstall {opts} {packages}
|
||||
install_command = pip install -U --force-reinstall {opts} {packages}
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands = py.test {posargs}
|
||||
whitelist_externals = bash
|
||||
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
||||
|
||||
[testenv:py27]
|
||||
basepython = python2.7
|
||||
setenv =
|
||||
PYTHONPATH={toxinidir}/../../../../sysinv/recipes-common/sysinv/sysinv:{toxinidir}/../../../../config/recipes-common/tsconfig/tsconfig
|
||||
|
||||
[testenv:pep8]
|
||||
commands =
|
||||
flake8 {posargs}
|
||||
|
Loading…
Reference in New Issue
Block a user