'Reboot the cache cluster'

def reboot(self):

    if (not self.exists()):
        msg = "'%s'    is    %s.    Cannot    reboot."
        self.module.fail_json(msg=(msg % (self.name, self.status)))
    if (self.status == 'rebooting'):
        return
    if (self.status in ['creating', 'modifying']):
        if self.wait:
            self._wait_for_status('available')
        else:
            msg = "'%s'    is    currently    %s.    Cannot    reboot."
            self.module.fail_json(msg=(msg % (self.name, self.status)))
    cache_node_ids = [cn['CacheNodeId'] for cn in self.data['CacheNodes']]
    try:
        self.conn.reboot_cache_cluster(CacheClusterId=self.name, CacheNodeIdsToReboot=cache_node_ids)
    except botocore.exceptions.ClientError as e:
        self.module.fail_json(msg=e.message, exception=format_exc(), **camel_dict_to_snake_dict(e.response))
    self._refresh_data()
    self.changed = True
    if self.wait:
        self._wait_for_status('available')
