예제 #1
0
파일: honeycomb.py 프로젝트: bholt/ipa
def configure(mode, quiet=False):
    settings = config['modes'][mode]
    yamlout = yaml.dump({mode: settings})

    if not quiet:
        puts(colored.green('>>> configuring'))
        puts(yamlout)

    for name, commands in settings.items():
        out = yaml.dump({mode: commands})
        swarm_exec(cass(name))("sh", "-c", fmt("echo '#{out}' > /honeycomb.yml"))
        for cmd in commands:
            swarm_exec(cass(name))(
                "tc", "qdisc", "replace", "dev", "eth0", "root", "netem", *cmd.split())
예제 #2
0
파일: honeycomb.py 프로젝트: bholt/ipa
def cmd_modes(extra=None, opt=None):
    print pretty_yaml({
        node: yaml.load(swarm_exec(node)("cat", "/honeycomb.yml").stdout)
        for node in containers('owl_cass')
    })
예제 #3
0
파일: honeycomb.py 프로젝트: bholt/ipa
def cmd_status(extra=None, opt=None):
    for node in containers('owl_cass'):
        puts(colored.magenta("[#{node}]", bold=True))
        puts(pretty_yaml(yaml.load(swarm_exec(node)("cat", "/honeycomb.yml").stdout)))