(self, cmdp)
return exit_status
rm: delete a container
        rm <container_id>
        -f                          :force removal
rm: delete a container
        rm <container_id>
        -f                          :force removal
rm : delete a container rm <container_id > - f : force removal
def do_rm(self, cmdp):
        """
        rm: delete a container
        rm <container_id>
        -f                          :force removal
        """
        force = cmdp.get("-f")
        container_id_list = cmdp.get("P*")
        if cmdp.missing_options():               # syntax error
            return self.STATUS_ERROR
        if not container_id_list:
            Msg().err("Error: must specify image:tag or repository/image:tag")
            return self.STATUS_ERROR

        exit_status = self.STATUS_OK
        for container_id in cmdp.get("P*"):
            container_id = self.localrepo.get_container_id(container_id)
            if not container_id:
                Msg().err("Error: invalid container id", container_id)
                exit_status = self.STATUS_ERROR
                continue

            if self.localrepo.isprotected_container(container_id):
                Msg().err("Error: container is protected")
                exit_status = self.STATUS_ERROR
                continue

            Msg().out("Info: deleting container:",
                      str(container_id), l=Msg.INF)
            if not self.localrepo.del_container(container_id, force):
                Msg().err("Error: deleting container")
                exit_status = self.STATUS_ERROR

        return exit_status
def do_rm ( self , cmdp ) : force = cmdp . get ( "-f" ) container_id_list = cmdp . get ( "P*" ) if cmdp . missing_options ( ) : # syntax error return self . STATUS_ERROR if not container_id_list : Msg ( ) . err ( "Error: must specify image:tag or repository/image:tag" ) return self . STATUS_ERROR exit_status = self . STATUS_OK for container_id in cmdp . get ( "P*" ) : container_id = self . localrepo . get_container_id ( container_id ) if not container_id : Msg ( ) . err ( "Error: invalid container id" , container_id ) exit_status = self . STATUS_ERROR continue if self . localrepo . isprotected_container ( container_id ) : Msg ( ) . err ( "Error: container is protected" ) exit_status = self . STATUS_ERROR continue Msg ( ) . out ( "Info: deleting container:" , str ( container_id ) , l = Msg . INF ) if not self . localrepo . del_container ( container_id , force ) : Msg ( ) . err ( "Error: deleting container" ) exit_status = self . STATUS_ERROR return exit_status