Пример #1
0
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
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
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)))