diff options
author | Scott Dodson <sdodson@redhat.com> | 2017-11-07 22:28:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-07 22:28:52 -0500 |
commit | 8e3b849d837407b9155bbe85025698bf9cf74e95 (patch) | |
tree | b1e454862b0a3de615fc920234fe04608a7ee955 /roles | |
parent | c42ef6a6963cd4337f858bf25187d0b94018e927 (diff) | |
parent | d59603544064990f87e8fc18d9ee6cef93592286 (diff) | |
download | openshift-8e3b849d837407b9155bbe85025698bf9cf74e95.tar.gz openshift-8e3b849d837407b9155bbe85025698bf9cf74e95.tar.bz2 openshift-8e3b849d837407b9155bbe85025698bf9cf74e95.tar.xz openshift-8e3b849d837407b9155bbe85025698bf9cf74e95.zip |
Merge pull request #6050 from ashcrow/possible-fix-for-scott
container_binary_sync: Remove atomic prefix from image
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_cli/library/openshift_container_binary_sync.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/roles/openshift_cli/library/openshift_container_binary_sync.py b/roles/openshift_cli/library/openshift_container_binary_sync.py index b40c49701..08045794a 100644 --- a/roles/openshift_cli/library/openshift_container_binary_sync.py +++ b/roles/openshift_cli/library/openshift_container_binary_sync.py @@ -36,7 +36,7 @@ class BinarySyncer(object): self.changed = False self.output = [] self.bin_dir = '/usr/local/bin' - self.image = image + self._image = image self.tag = tag self.backend = backend self.temp_dir = None # TBD @@ -142,6 +142,33 @@ class BinarySyncer(object): self.output.append("Moved %s to %s." % (src_path, dest_path)) self.changed = True + @property + def raw_image(self): + """ + Returns the image as it was originally passed in to the instance. + + .. note:: + This image string will only work directly with the atomic command. + + :returns: The original image passed in. + :rtype: str + """ + return self._image + + @property + def image(self): + """ + Returns the image without atomic prefixes used to map to skopeo args. + + :returns: The image string without prefixes + :rtype: str + """ + image = self._image + for remove in ('oci:', 'http:', 'https:'): + if image.startswith(remove): + image = image.replace(remove, '') + return image + def main(): module = AnsibleModule( # noqa: F405 |