From a164cd3919bea74411d37118ba941f96435de9c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Dunand?= <aurelien.dunand@smartjog.com>
Date: Thu, 4 Aug 2011 09:40:24 +0200
Subject: [PATCH] Add image retrieval from ftp

Signed-off-by: Seblu <sebastien.luttringer@smartjog.com>
---
 installsystems/tools.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/installsystems/tools.py b/installsystems/tools.py
index ec03eab..f54b116 100644
--- a/installsystems/tools.py
+++ b/installsystems/tools.py
@@ -57,7 +57,7 @@ def copy(source, destination, uid=None, gid=None, mode=None, timeout=None):
     # trivial case
     if stype == dtype == "file":
         shutil.copy(source, destination)
-    elif stype == "http" and dtype == "file":
+    elif (stype == "http" or stype == "ftp") and dtype == "file":
         f_dest = open(destination, "w")
         f_source = urllib2.urlopen(source, timeout=timeout)
         f_dest.write(f_source.read())
@@ -113,7 +113,7 @@ def abspath(path):
     Format a path to be absolute
     '''
     ptype = pathtype(path)
-    if ptype in ("http", "ssh"):
+    if ptype in ("http", "ftp", "ssh"):
         return path
     elif ptype == "file":
         if path.startswith("file://"):
-- 
GitLab