diff --git a/akanda/rug/cli/browse.py b/akanda/rug/cli/browse.py index 5d883e4f..f92d54fc 100644 --- a/akanda/rug/cli/browse.py +++ b/akanda/rug/cli/browse.py @@ -26,7 +26,13 @@ import threading from contextlib import closing from datetime import datetime -from blessed import Terminal +try: + from blessed import Terminal +except ImportError: + # blessed is not part of openstack global-requirements. + raise Exception("The 'blessed' python module is required to browse" + " Akanda routers. Please install and try again.") + from oslo.config import cfg from akanda.rug import commands diff --git a/akanda/rug/test/unit/api/test_rug_api.py b/akanda/rug/test/unit/api/test_rug_api.py index c435a7b5..a3d39969 100644 --- a/akanda/rug/test/unit/api/test_rug_api.py +++ b/akanda/rug/test/unit/api/test_rug_api.py @@ -8,6 +8,12 @@ from cliff import commandmanager from akanda.rug.api import rug from akanda.rug.openstack.common import log as logging +try: + import blessed # noqa + HAS_BLESSED = True +except ImportError: + HAS_BLESSED = False + class TestRugAPI(unittest.TestCase): @@ -19,6 +25,7 @@ class TestRugAPI(unittest.TestCase): self.api = rug.RugAPI(ctl) self.ctl = ctl.return_value + @unittest.skipUnless(HAS_BLESSED, "blessed not available") def test_browse(self): resp = self.api(webob.Request({ 'REQUEST_METHOD': 'PUT', diff --git a/requirements.txt b/requirements.txt index ec909a8a..2d5c5dd9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,3 @@ kombu>=2.4.8 WebOb>=1.2.3,<1.3 python-novaclient>=2.15.0 cliff>=1.4.3 -blessed>=1.9.1