diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-04-13 15:06:35 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cbosdonnat@suse.com> | 2017-04-14 10:35:10 +0200 |
commit | 7343816a5c6de7e54bfa21317239af4380c792b4 (patch) | |
tree | 0b481230cbec43ba53ecb1512f68af75884ede53 /sources.py | |
parent | 612c5bbb7babe41b463297576710d60ee6188dee (diff) | |
download | virt-bootstrap.git-7343816a5c6de7e54bfa21317239af4380c792b4.tar.gz virt-bootstrap.git-7343816a5c6de7e54bfa21317239af4380c792b4.tar.xz virt-bootstrap.git-7343816a5c6de7e54bfa21317239af4380c792b4.zip |
Remove trailing slash after docker image
Skopeo does not accept any trailing slash at the end of the url.
See https://github.com/projectatomic/skopeo#copying-images.
Diffstat (limited to 'sources.py')
-rw-r--r-- | sources.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -55,8 +55,9 @@ class DockerSource: self.username = username self.password = password self.insecure = insecure - if self.image.startswith('/'): - self.image = self.image[1:] + if self.image and not self.image.startswith('/'): + self.image = '/' + self.image + self.url = "docker://" + self.registry + self.image def unpack(self, dest): tmpDest = tempfile.mkdtemp('virt-bootstrap') @@ -67,7 +68,7 @@ class DockerSource: # they should place the certificates in the system # folders for broader enablement cmd = ["skopeo", "copy", - "docker://%s/%s" % (self.registry, self.image), + self.url, "dir:%s" % tmpDest] if self.insecure: cmd.append('--src-tls-verify=false') |