(self, cmdp)
return self.STATUS_ERROR
export : export container (directory tree) to a tar file or stdin
        export -o <tar-file> <container-id>
        export - <container-id>
        -o                         :export to file, instead of stdout
        --clone                    :export in clone (udocker) format
export : export container (directory tree) to a tar file or stdin
        export -o <tar-file> <container-id>
        export - <container-id>
        -o                         :export to file, instead of stdout
        --clone                    :export in clone (udocker) format
export : export container ( directory tree ) to a tar file or stdin export - o <tar - file > <container - id > export - <container - id > - o : export to file instead of stdout -- clone : export in clone ( udocker ) format
def do_export(self, cmdp):
        """
        export : export container (directory tree) to a tar file or stdin
        export -o <tar-file> <container-id>
        export - <container-id>
        -o                         :export to file, instead of stdout
        --clone                    :export in clone (udocker) format
        """
        to_file = cmdp.get("-o")
        clone = cmdp.get("--clone")
        if to_file:
            tarfile = cmdp.get("P1")
            container_id = cmdp.get("P2")
        else:
            tarfile = "-"
            container_id = cmdp.get("P1")
        if cmdp.missing_options():  # syntax error
            return self.STATUS_ERROR
        container_id = self.localrepo.get_container_id(container_id)
        if not container_id:
            Msg().err("Error: invalid container id", container_id)
            return self.STATUS_ERROR
        if not tarfile:
            Msg().err("Error: invalid output file name", tarfile)
            return self.STATUS_ERROR
        if to_file:
            Msg().out("Info: exporting to file", tarfile)

        cstruct = ContainerStructure(self.localrepo, container_id)
        if clone:
            if cstruct.clone_tofile(tarfile):
                return self.STATUS_OK
        else:
            if cstruct.export_tofile(tarfile):
                return self.STATUS_OK

        Msg().err("Error: exporting")
        return self.STATUS_ERROR
def do_export ( self , cmdp ) : to_file = cmdp . get ( "-o" ) clone = cmdp . get ( "--clone" ) if to_file : tarfile = cmdp . get ( "P1" ) container_id = cmdp . get ( "P2" ) else : tarfile = "-" container_id = cmdp . get ( "P1" ) if cmdp . missing_options ( ) : # syntax error return self . STATUS_ERROR container_id = self . localrepo . get_container_id ( container_id ) if not container_id : Msg ( ) . err ( "Error: invalid container id" , container_id ) return self . STATUS_ERROR if not tarfile : Msg ( ) . err ( "Error: invalid output file name" , tarfile ) return self . STATUS_ERROR if to_file : Msg ( ) . out ( "Info: exporting to file" , tarfile ) cstruct = ContainerStructure ( self . localrepo , container_id ) if clone : if cstruct . clone_tofile ( tarfile ) : return self . STATUS_OK else : if cstruct . export_tofile ( tarfile ) : return self . STATUS_OK Msg ( ) . err ( "Error: exporting" ) return self . STATUS_ERROR