Skip to content

Instantly share code, notes, and snippets.

View abadger's full-sized avatar

Toshio Kuratomi abadger

View GitHub Profile
@abadger
abadger / 0001-WIP-make-testdocs.patch
Last active February 15, 2021 17:07
Sample make testdocs target to test as much of the documentation as possible
From 3b6a0f335860d62c16e95b749a0b290bc8606835 Mon Sep 17 00:00:00 2001
From: Toshio Kuratomi <[email protected]>
Date: Mon, 15 Feb 2021 09:03:56 -0800
Subject: [PATCH] [WIP] make testdocs
---
docs/docsite/Makefile | 10 +
docs/docsite/sphinx_conf/test_conf.py | 296 ++++++++++++++++++++++++++
test/sanity/code-smell/docs-build.py | 2 +-
3 files changed, 307 insertions(+), 1 deletion(-)
@abadger
abadger / parse-logs.py
Created January 12, 2021 20:07
Parse the antsibull log file for how many times each docs macro is used.
#!/usr/bin/python3 -tt
# Script to parse the antsibull log and gather the number of times each of the macros were used in
# a run of the docs build.
import json
import re
from collections import Counter
@abadger
abadger / gist:439efd341ed5d2e29a04cda92dc7cbbe
Created October 7, 2020 17:23
Writing a class which returns different instances depending on an external factor.
#!/usr/bin/python3 -tt
import abc
import os
class Base(metaclass=abc.ABCMeta):
@abc.abstractmethod
def run(self):
pass
@abadger
abadger / gist:934097f985f553b598f03c84167a2b24
Created August 13, 2020 19:07
sections of ansible release annoucnement about pip install
Excerpts from: https://groups.google.com/forum/#!topic/ansible-devel/58Fpvscb53g
[..]
How to get it
-------------
Due to a limitation in pip, you need to uninstall Ansible 2.9 (or
earlier) before installing the 2.10 version:
@abadger
abadger / basic.py
Created August 12, 2020 17:04
First attempt to separate unix-like atomic move functionality from change detection.
# Copyright (c), Michael DeHaan <[email protected]>, 2012-2013
# Copyright (c), Toshio Kuratomi <[email protected]> 2016
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
FILE_ATTRIBUTES = {
'A': 'noatime',
'a': 'append',
Hi all, Ansible-2.10 has been a big change in how we develop Ansible with development split between the ansible-base and ansible packages. Although the development schedule has been known for a long time, we're only finalizing the release schedule for Ansible-2.10.0 now.
Here is the release schedule for Ansible-2.10.0 with important dates for ansible-base interwoven.
## Dates already passed:
2020-06-23: Ansible 2.10 Alpha freeze date. No net new collections.
2020-07-10: Ansible collections freeze date for content shuffling. Content
should be in its final collection for the ansible-2.10 release.
ERROR:antsibull:func=write_rst:mod=antsibull.write_docs:nonfatal_errors=['18 validation errors for PluginDocSchema\ndoc -> options -> ca_path -> ini -> 0 -> key\n field required (type=value_error.missing)\ndoc -> options -> ca_path -> ini -> 1 -> section\n field required (type=value_error.missing)\ndoc -> options -> follow_redirects -> ini -> 0 -> key\n field required (type=value_error.missing)\ndoc -> options -> follow_redirects -> ini -> 1 -> section\n field required (type=value_error.missing)\ndoc -> options -> force -> ini -> 0 -> key\n field required (type=value_error.missing)\ndoc -> options -> force -> ini -> 1 -> section\n field required (type=value_error.missing)\ndoc -> options -> force_basic_auth -> ini -> 0 -> key\n field required (type=value_error.missing)\ndoc -> options -> force_basic_auth -> ini -> 1 -> section\n field required (type=value_error.missing)\ndoc -> options -> http_agent -> ini -> 0 -> key\n field required (type=value_error.missing)\ndoc -> options -> http_agent -> ini ->
@abadger
abadger / gist:158d752815845cf3e63bbc738ca203f4
Created July 8, 2020 16:10
M() references that need to be updated: 2020-07-08
/srv/ansible/stable-2.10/docs/docsite/rst/collections/amazon/aws/aws_s3_module.rst:608: WARNING: undefined label: ansible_collections.aws_s3_module (if the link has no caption the label must precede a section header)
/srv/ansible/stable-2.10/docs/docsite/rst/collections/amazon/aws/ec2_module.rst:46: WARNING: undefined label: ansible_collections.ec2_module (if the link has no caption the label must precede a section header)
/srv/ansible/stable-2.10/docs/docsite/rst/collections/amazon/aws/ec2_module.rst:46: WARNING: undefined label: ansible_collections.ec2_instance_module (if the link has no caption the label must precede a section header)
/srv/ansible/stable-2.10/docs/docsite/rst/collections/amazon/aws/ec2_module.rst:46: WARNING: undefined label: ansible_collections.ec2_instance_module (if the link has no caption the label must precede a section header)
/srv/ansible/stable-2.10/docs/docsite/rst/collections/amazon/aws/ec2_module.rst:46: WARNING: undefined label: ansible_collections.ec2_module (if the link has n
[pts/148@peru /var/tmp/testing/foo2]$ python3.7 -m pip install foo==2.0 --index-url=https://toshio.fedorapeople.org/sdists
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://toshio.fedorapeople.org/sdists
Collecting foo==2.0
Using cached https://toshio.fedorapeople.org/sdists/foo/foo-2.0.tar.gz (1.2 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/var/tmp/pip-install-0poe412p/foo/setup.py'"'"'; __file__='"'"'/var/tmp/pip-install-0poe412p/foo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /var/tmp/pip-pip-egg-info-sfyj2n9g
cwd: /var/tmp/pip-install-0poe412p/foo/
Complete output (1 line):
Uninstall foo before installing foo2.0
@abadger
abadger / gist:5780c6ecbe840cd16bbe3b4fc0e44f99
Created June 11, 2020 16:17
temporary: output of ansible-doc --json
[pts/140@peru ~/tmp]$ ANSIBLE_COLLECTIONS_PATHS=amazon ansible-doc --json -t module community.vmware.vsphere_file (09:08:05)
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can
become unstable at any point.
{
"community.vmware.vsphere_file": {
"doc": {
"author": [
"Dag Wieers (@dagwieers)"
],