From 2a2805150e3028dc98f1ed5948ffd3b5f98fdbba Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Wed, 11 Mar 2020 00:29:55 +0100 Subject: [PATCH] Pull out base url --- modules/install/ToolsInstaller.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/install/ToolsInstaller.py b/modules/install/ToolsInstaller.py index 42e8156..d494c79 100644 --- a/modules/install/ToolsInstaller.py +++ b/modules/install/ToolsInstaller.py @@ -44,15 +44,12 @@ class ToolsInstaller: else: print("Version not supported by this installer") return + + base_url = f"https://download.docker.com/linux/${linux_distro}" - subprocess.run("curl -fsSL " - f"https://download.docker.com/linux/${linux_distro}/gpg " - "| sudo apt-key add -", - shell=True) + subprocess.run("curl -fsSL " + base_url + "/gpg | sudo apt-key add -", shell=True) subprocess.run("apt-key fingerprint 0EBFCD88", shell=True) - subprocess.run("add-apt-repository \"deb [arch=amd64] " - f"https://download.docker.com/linux/${linux_distro}" - "$(lsb_release -cs) stable\"", + subprocess.run("add-apt-repository \"deb [arch=amd64] " + base_url + " $(lsb_release -cs) stable\"", shell=True) else: print("skip adding of the key")