def _handle_rm_force(self, parsed_globals, parameters):
        """
        This function recursively deletes objects in a bucket if the force
        parameter was thrown when using the remove bucket command. It will
        refuse to delete if a key is specified in the s3path.
        """
        # XXX: This shouldn't really be here.  This was originally moved from
        # the CommandParameters class to here, but this is still not the ideal
        # place for this code.  This should be moved
        # to either the CommandArchitecture class, or the RbCommand class where
        # the actual operations against S3 are performed.  This may require
        # some refactoring though to move this to either of those classes.
        # For now, moving this out of CommandParameters allows for that class
        # to be kept simple.
        if 'force' in parameters:
            if parameters['force']:
                bucket, key = find_bucket_key(parameters['src'][5:])
                if key:
                    raise ValueError('Please specify a valid bucket name only.'
                                     ' E.g. s3://%s' % bucket)
                path = 's3://' + bucket
                del_objects = RmCommand(self._session)
                rc = del_objects([path, '--recursive'], parsed_globals)
                if rc != 0:
                    raise RuntimeError(
                        "Unable to delete all objects in the bucket, "
                        "bucket will not be deleted.")
dataset/ETHPy150Open aws/aws-cli/awscli/customizations/s3/subcommands.py/S3TransferCommand._handle_rm_force/original