Skip to content

Instantly share code, notes, and snippets.

View Crapworks's full-sized avatar

Christian Eichelmann Crapworks

View GitHub Profile
@Crapworks
Crapworks / metatest1.py
Created December 27, 2012 13:52
My first steps into python metaprogramming. Not sure if this really makes sense, but at least it was reasonable for me.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from struct import pack, unpack
from binascii import hexlify, unhexlify
class HWAddr(object):
fmt = "6s"
def __init__(self, addr="FF:FF:FF:FF:FF:FF"):
@Crapworks
Crapworks / metatest2.py
Created December 29, 2012 19:22
My seconds steps into python metaclassing. Dont know if this makes sense, but at least it works as expected.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
### meta.py ###
class Meta(object):
def __init__(self, declarative_dict):
self.declarative_dict = declarative_dict
def make(self):
print "Let's have some %s" % (", ".join([ "%s (%s)" % (value, key) for key, value in self.declarative_dict.iteritems()]), )
@Crapworks
Crapworks / nervernsaege.py
Created December 31, 2012 11:53
Frühstück für die Nervensäge
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
### meta.py ###
class Meta(object):
def __init__(self, declarative_dict):
self.declarative_dict = declarative_dict
def make(self):
print "Das Frühstück ist angerichtet:"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import requests
__version__ = '0.1'
class KubeStatus(object):
2017/08/24 11:52:18 [INFO] Terraform version: 0.10.2 a1d06eb97378d097d4175c3284ea026937618477
2017/08/24 11:52:18 [INFO] Go runtime version: go1.8.3
2017/08/24 11:52:18 [INFO] CLI args: []string{"/usr/bin/terraform", "plan", "-var-file=../../parameter.tvars"}
2017/08/24 11:52:18 [DEBUG] Attempting to open CLI config file: /home/christian/.terraformrc
2017/08/24 11:52:18 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/08/24 11:52:18 [INFO] CLI command args: []string{"plan", "-var-file=../../parameter.tvars"}
2017/08/24 11:52:18 [INFO] command: empty terraform config, returning nil
2017/08/24 11:52:18 [DEBUG] command: no data state file found for backend config
2017/08/24 11:52:18 [DEBUG] New state was assigned lineage "e7ee7f36-2e45-4fe8-bd68-9ebed929a8ed"
2017/08/24 11:52:18 [INFO] command: backend initialized: <nil>
openstack_lb_listener_v2.listener: Creating...
admin_state_up: "" => "true"
connection_limit: "" => "<computed>"
default_pool_id: "" => "<computed>"
template_dir.config: Refreshing state... (ID: e1de3fede741c0a9b3792ddea93feacd4c8d79b9)
data.template_file.webserver: Refreshing state...
2017-08-31T10:55:34.389+0200 [DEBUG] plugin.terraform-provider-openstack_v0.2.0_x4: 2017/08/31 10:55:34 [DEBUG] Openstack Response Code: 201
2017-08-31T10:55:34.390+0200 [DEBUG] plugin.terraform-provider-openstack_v0.2.0_x4: 2017/08/31 10:55:34 [DEBUG] Openstack Response Headers:
2017-08-31T10:55:34.390+0200 [DEBUG] plugin.terraform-provider-openstack_v0.2.0_x4: Content-Type: application/json
2017-08-31T10:55:34.390+0200 [DEBUG] plugin.terraform-provider-openstack_v0.2.0_x4: Date: Thu, 31 Aug 2017 08:55:36 GMT
2017-08-31T10:55:34.390+0200 [DEBUG] plugin.terraform-provider-openstack_v0.2.0_x4: Server: nginx