Skip to content

Instantly share code, notes, and snippets.

View tbielawa's full-sized avatar
💭
bitmath!

Tim Case tbielawa

💭
bitmath!
View GitHub Profile
From 90753be1fa32088eca3174cc3f6ba11014a2cac5 Mon Sep 17 00:00:00 2001
From: Tim Bielawa <[email protected]>
Date: Fri, 2 Sep 2016 09:16:04 -0700
Subject: [PATCH] Fix string substitution error in the to_padded_yaml filter
---
filter_plugins/oo_filters.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
@tbielawa
tbielawa / AFTER
Created August 25, 2016 15:14
Openshift-Ansible PEP8 - before and after fixes
#############################################
# Running PEP8 Compliance Tests in virtualenv
#############################################
. oo-installenv/bin/activate && pep8 --ignore=E501,E121,E124 src/ooinstall/
@tbielawa
tbielawa / bitmath-examples-1.3.1.py
Created August 24, 2016 16:26
Examples of bitmath 1.3.1 - Unsafe Unit Parsing
>>> import bitmath
>>> parsed = bitmath.parse_string('100k')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tbielawa/lib/python/bitmath/__init__.py", line 1396, in parse_string
raise ValueError("The unit %s is not a valid bitmath unit" % unit)
ValueError: The unit k is not a valid bitmath unit
>>> parsed = bitmath.parse_string_unsafe('100k')
>>> parsed == bitmath.kB(100)
True
#############################################
# Running PEP8 Compliance Tests in virtualenv
#############################################
. oo-installenv/bin/activate && pep8 --ignore=E501,E121,E124 src/ooinstall/
src/ooinstall/cli_installer.py:31:21: E126 continuation line over-indented for hanging indent
src/ooinstall/cli_installer.py:31:26: E231 missing whitespace after ':'
src/ooinstall/cli_installer.py:32:28: E126 continuation line over-indented for hanging indent
src/ooinstall/cli_installer.py:32:43: E203 whitespace before ':'
src/ooinstall/cli_installer.py:32:44: E231 missing whitespace after ':'
src/ooinstall/cli_installer.py:33:44: E231 missing whitespace after ':'
#############################################
# Creating a virtualenv
#############################################
virtualenv oo-installenv
New python executable in oo-installenv/bin/python2
Also creating executable in oo-installenv/bin/python
Installing setuptools, pip...done.
. oo-installenv/bin/activate && pip install -r requirements.txt
You are using pip version 6.0.8, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@deepfryer ~]# atomic-openshift-installer -c installer.cfg.yml install
Welcome to the OpenShift Enterprise 3 installation.
Please confirm that following prerequisites have been met:
* All systems where OpenShift will be installed are running Red Hat Enterprise
Linux 7.
* All systems are properly subscribed to the required OpenShift Enterprise 3
#############################################
# Running PEP8 Compliance Tests in virtualenv
#############################################
. oo-installenv/bin/activate && pep8 --ignore=E501,E121,E124 src/ooinstall/
src/ooinstall/cli_installer.py:31:21: E126 continuation line over-indented for hanging indent
src/ooinstall/cli_installer.py:31:26: E231 missing whitespace after ':'
src/ooinstall/cli_installer.py:32:28: E126 continuation line over-indented for hanging indent
src/ooinstall/cli_installer.py:32:43: E203 whitespace before ':'
src/ooinstall/cli_installer.py:32:44: E231 missing whitespace after ':'
src/ooinstall/cli_installer.py:33:44: E231 missing whitespace after ':'
#############################################
# Creating a virtualenv
#############################################
virtualenv oo-installenv
New python executable in oo-installenv/bin/python2
Also creating executable in oo-installenv/bin/python
Installing setuptools, pip...done.
. oo-installenv/bin/activate && pip install -r requirements.txt
You are using pip version 6.0.8, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
@tbielawa
tbielawa / _ansible-role-graph.sh
Last active July 9, 2016 19:11
Basic completion for openshift-ansible's role dep grapher. Needs a lot more work
#compdef ansible-role-graph
# This guide was helpful getting this kickstarted
# https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
local engines
local formats
engines="dot fdp sfdp"
formats="pdf png svg"
#!/usr/bin/env python
import click
from glob import glob
import graphviz as gv
import os
import sys
import yaml
''' Generate a directed graph of ansible role dependencies.