diff --git a/kolla/image/build.py b/kolla/image/build.py index 6c8aa857e5..07efe0f02a 100644 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -17,7 +17,6 @@ from __future__ import print_function import contextlib import datetime import errno -import graphviz import json import logging import os @@ -859,6 +858,11 @@ class KollaWorker(object): self.images.append(image) def save_dependency(self, to_file): + try: + import graphviz + except ImportError: + LOG.error('"graphviz" is required for save dependency') + raise dot = graphviz.Digraph(comment='Docker Images Dependency') dot.body.extend(['rankdir=LR']) for image in self.images: diff --git a/requirements.txt b/requirements.txt index 0b5a62d853..4d3d9842df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,6 @@ gitdb>=0.6.4 # BSD License (3 clause) GitPython>=1.0.1 # BSD License (3 clause) six>=1.9.0 # MIT oslo.config>=3.14.0 # Apache-2.0 -graphviz!=0.5.0,>=0.4.0 # MIT License setuptools!=24.0.0,>=16.0 # PSF/ZPL pycrypto>=2.6 # Public Domain netaddr>=0.7.13,!=0.7.16 # BSD diff --git a/test-requirements.txt b/test-requirements.txt index 883a8019c1..7247553c36 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,6 +6,7 @@ bashate>=0.2 # Apache-2.0 beautifulsoup4 # MIT doc8 # Apache-2.0 extras # MIT +graphviz!=0.5.0,>=0.4.0 # MIT License hacking>=0.10.0 oslo.log>=3.11.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0