diff --git a/ospurge/resources/swift.py b/ospurge/resources/swift.py index 121c3b8..95d75b5 100644 --- a/ospurge/resources/swift.py +++ b/ospurge/resources/swift.py @@ -30,7 +30,8 @@ class Objects(base.ServiceResource, glance.ListImagesMixin, ListObjectsMixin): self.cloud.list_volume_backups() == []) def list(self): - yield from self.list_objects() + for item in self.list_objects(): + yield item def delete(self, resource): self.cloud.delete_object(resource['container_name'], resource['name']) diff --git a/ospurge/utils.py b/ospurge/utils.py index 8830f37..07dae58 100644 --- a/ospurge/utils.py +++ b/ospurge/utils.py @@ -59,12 +59,12 @@ def monkeypatch_oscc_logging_warning(f): oscc_target = 'os_client_config.cloud_config' orig_logging = logging.getLogger(oscc_target).warning - def logging_warning(msg: str, *args, **kwargs): + def logging_warning(msg, *args, **kwargs): if 'catalog entry not found' not in msg: orig_logging(msg, *args, **kwargs) @functools.wraps(f) - def wrapper(*args: list, **kwargs): + def wrapper(*args, **kwargs): try: setattr(logging.getLogger(oscc_target), 'warning', logging_warning) return f(*args, **kwargs) diff --git a/tox.ini b/tox.ini index 198e5bc..a5fbb51 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pep8,pip-check-reqs,cover,py35 +envlist = pep8,pip-check-reqs,cover,py35,py27 minversion = 1.9 skipsdist = True @@ -8,13 +8,12 @@ usedevelop=True deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -basepython = - run,pep8,cover,mypy,pip-check-reqs,py35,functional: python3.5 - docs,venv: python2 +basepython = python3 commands = python setup.py testr --testr-args='{posargs}' [testenv:venv] +basepython = python2.7 commands = {posargs} [testenv:run] @@ -60,6 +59,7 @@ commands= pip-missing-reqs -d ospurge [testenv:docs] +basepython = python2.7 whitelist_externals = echo skip_install = True deps =