Skip to content
import os
import subprocess
import yaml
from charmhelpers.core import hookenv
LATEST = "latest"
class Service(dict):
import subprocess
import re
regex = re.compile('([A-Z]+)=(?:"(.*?)")')
def blocks():
blocks = []
output = subprocess.check_output([
"sudo", "lsblk", "-P", "-o",
View gist:41552afa0eef5730c686
2014-10-26 02:33:12 INFO network-relation-changed Registering machine
2014-10-26 02:33:12 INFO network-relation-changed registration request
{'kind': 'Minion', 'id': u'',
'resources': {'capacity': {'mem': '2049988 K', 'cpu': 2}}, 'hostIP': u''}
2014-10-26 02:33:12 INFO network-relation-changed registration result
"message":"The requested resource does not exist.",
View gist:194a934ca96eea0411a9
series: trusty
charm: kubernetes-master
charm: flannel
num_units: 2
container_type: docker
Simple usage to log into a container via ssh
$ lxc-host -s -n container_name
Simple usage to query the addresses of a container
$ lxc-host -n container_name
View capture dependency as library
sudo apt-get install python-virtualenv
virtualenv tosca-dev
source tosca-dev/bin/activate
git clone
# Edit access
git clone
#!/usr/bin/env python
import argparse
import sys
import logging
from boto.ec2 import regions, connect_to_region
def main():
View gist:c65b1dc77f6832c31bff
# Capture all the deps
mkdir dist-cache
pip install -d dist-cache -r requirements.txt
cd ..
tar czvf mypackage-archive.tgz
# Transfer that to a new machine
# On the separate machine in a virtualenv
# Extract tarball and use
View azure-instance-info.txt
svc host fault upgrade size power ip
42fzbcx2ev juju0nezlcysed3o... 0 0 Small Started
42fzbcx2ev juju9bd6mjna00h0... 0 4 Small Started
42fzbcx2ev juju9ygqoy9qjkdq... 1 1 Small Started
42fzbcx2ev jujufrh460g4vyra... 1 0 Small Started
42fzbcx2ev jujukhrocaqpux90... 1 3 Small Started
42fzbcx2ev jujuzbbtbkk8tdo6... 0 2 Small Started
47rntclyak jujugk2ygbnatkhc... 0 0 Small Started
51etwr329x juju6329s6bqqao2... 0 0 Small Started
51etwr329x jujuuxa3sfxyp12f... 1 1 Small Started
View juju reboot support
api for unit agent request shutdown on self machine (triggered by hook exit value)
api for unit agent to watch for shutdown on machine
-> on receipt
stops further hook exec / blocking on the current one if any
signals ready for shutdown
api for unit agent to signal ready for shutdown
api for machine agent watch for shutdown
-> on shutdown recieved
-> disables unit deployment
Something went wrong with that request. Please try again.