(self, version)
return True
Set the version of the image TAG repository currently
        it supports Docker images with versions v1 and v2
        to be invoked after setup_tag()
Set the version of the image TAG repository currently
        it supports Docker images with versions v1 and v2
        to be invoked after setup_tag()
Set the version of the image TAG repository currently it supports Docker images with versions v1 and v2 to be invoked after setup_tag ()
def set_version(self, version):
        """Set the version of the image TAG repository currently
        it supports Docker images with versions v1 and v2
        to be invoked after setup_tag()
        """
        if not (self.cur_repodir and self.cur_tagdir):
            return False
        if not os.path.exists(self.cur_repodir):
            return False
        if not os.path.exists(self.cur_tagdir):
            return False
        directory = self.cur_tagdir
        if (os.path.exists(directory + "/v1") and version != "v1" or
                os.path.exists(directory + "/v2") and version != "v2"):
            if len(os.listdir(directory)) == 1:
                try:
                    FileUtil(directory + "/v1").remove()
                    FileUtil(directory + "/v2").remove()
                except (IOError, OSError):
                    pass
                if os.listdir(directory):
                    return False
        try:
            # Create version file
            open(directory + "/" + version, 'a').close()
        except (IOError, OSError):
            return False
        return True
def set_version ( self , version ) : if not ( self . cur_repodir and self . cur_tagdir ) : return False if not os . path . exists ( self . cur_repodir ) : return False if not os . path . exists ( self . cur_tagdir ) : return False directory = self . cur_tagdir if ( os . path . exists ( directory + "/v1" ) and version != "v1" or os . path . exists ( directory + "/v2" ) and version != "v2" ) : if len ( os . listdir ( directory ) ) == 1 : try : FileUtil ( directory + "/v1" ) . remove ( ) FileUtil ( directory + "/v2" ) . remove ( ) except ( IOError , OSError ) : pass if os . listdir ( directory ) : return False try : # Create version file open ( directory + "/" + version , 'a' ) . close ( ) except ( IOError , OSError ) : return False return True