This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from charmhelpers.relations import hook, RelationBase | |
class MysqlClient(RelationBase): | |
cache_keys = ['host', 'port', 'user', 'password'] | |
@hook('relation-changed') | |
def db_connectable(self): | |
data = self.data_available(self.dsn_keys) | |
if data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from charmhelpers.core import when, when_not | |
import framework | |
import helpers | |
CONFIG_FILE = "/etc/myapp/app.conf" | |
@when("db.connectable", "cache.ready") | |
def regen_config(db, cache): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import pprint | |
import networkx as nx | |
import jujuclient | |
import yaml | |
def setup(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== modified file 'cloudfoundry/utils.py' | |
--- cloudfoundry/utils.py 2014-10-27 19:30:20 +0000 | |
+++ cloudfoundry/utils.py 2014-10-27 19:41:54 +0000 | |
@@ -438,9 +438,13 @@ | |
return None | |
for server in ['@8.8.8.8', '']: | |
- output = subprocess.check_output( | |
- filter(None, ['dig', '+short', server, address])) | |
- result = filter_ip(output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import pprint | |
import networkx as nx | |
import yaml | |
def setup(): | |
parser = argparse.ArgumentParser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cloudfoundry: | |
relations: | |
- - login:uaa | |
- - uaa:uaa | |
- - loggregator-trafficcontrol:cc | |
- - cc:cc | |
- - etcd:client | |
- - cc-clock:etcd | |
- cc-worker:etcd | |
- router:etcd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cloudfoundry: | |
relations: | |
- - login:uaa | |
- - uaa:uaa | |
- - loggregator-trafficcontrol:cc | |
- - cc:cc | |
- - etcd:client | |
- - cc-clock:etcd | |
- cc-worker:etcd | |
- router:etcd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First, make sure that cgroups are mounted correctly. | |
CGROUP=/sys/fs/cgroup | |
: {LOG:=stdio} | |
[ -d $CGROUP ] || mkdir $CGROUP | |
mountpoint -q $CGROUP || | |
mount -n -t tmpfs -o uid=0,gid=0,mode=0755 cgroup $CGROUP || { | |
echo "Could not make a tmpfs mount. Did you use -privileged?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import pprint | |
from jujuclient import Environment | |
def setup(): | |
parser = argparse.ArgumentParser() |