[virt-tools-list] [virt-bootstrap] [PATCH v2 3/3] source-docker: Show error if skopeo not installed

Radostin Stoyanov rstoyanov1 at gmail.com
Tue Nov 21 12:08:35 UTC 2017


Show appropriate error message when skopeo is not installed.
---
 src/virtBootstrap/sources/docker_source.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/virtBootstrap/sources/docker_source.py b/src/virtBootstrap/sources/docker_source.py
index ef72d64..a73fa64 100644
--- a/src/virtBootstrap/sources/docker_source.py
+++ b/src/virtBootstrap/sources/docker_source.py
@@ -62,6 +62,10 @@ class DockerSource(object):
             [[<start>, <target>, <count>], [<start>, <target>, <count>] ...]
         """
 
+        # Check if skopeo is installed
+        if not utils.is_installed('skopeo'):
+            raise RuntimeError('skopeo is not installed')
+
         self.url = self.gen_valid_uri(kwargs['uri'])
         self.username = kwargs.get('username', None)
         self.password = kwargs.get('password', None)
-- 
2.13.6




More information about the virt-tools-list mailing list