On your charms code, put a trace exception
from charmhelpers.contrib.python import pdb
@hooks.hook()
def install():
pdb.set_trace()
...
ubuntu@niedbalski-bastion:~/charms$ juju run --service rabbitmq-server "sudo cat /etc/hosts" | |
- MachineId: "4" | |
Stdout: | | |
127.0.0.1 localhost | |
# The following lines are desirable for IPv6 capable hosts | |
::1 ip6-localhost ip6-loopback | |
fe00::0 ip6-localnet | |
ff00::0 ip6-mcastprefix | |
ff02::1 ip6-allnodes |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
__author__ = 'Jorge Niedbalski R. <jnr@pyrosome.org>' | |
class SPF: | |
valid_moves = [(-1, -2), |
=== modified file 'deployer/action/importer.py' | |
--- deployer/action/importer.py 2014-05-29 17:03:15 +0000 | |
+++ deployer/action/importer.py 2014-05-29 20:45:52 +0000 | |
@@ -60,7 +60,7 @@ | |
self.log.debug("Getting charms...") | |
self.deployment.fetch_charms( | |
update=self.options.update_charms, | |
- no_local_mods=self.options.no_local_mods) | |
+ local_mods=self.options.local_mods) | |
=== modified file 'charmtools/templates/python/files/scripts/charm_helpers_sync.py' | |
--- charmtools/templates/python/files/scripts/charm_helpers_sync.py 2014-05-23 20:10:24 +0000 | |
+++ charmtools/templates/python/files/scripts/charm_helpers_sync.py 2014-05-30 20:19:55 +0000 | |
@@ -30,7 +30,7 @@ | |
def clone_helpers(work_dir, branch): | |
dest = os.path.join(work_dir, 'charm-helpers') | |
logging.info('Checking out %s to %s.' % (branch, dest)) | |
- cmd = ['bzr', 'branch', branch, dest] | |
+ cmd = ['bzr', 'checkout', '--lightweight', branch, dest] | |
subprocess.check_call(cmd) |
#!/usr/bin/env python | |
""" | |
Usage: | |
$ juju get-grep service config_entry | |
""" | |
__author__ == "Jorge Niedbalski R. <jorge.niedbalski@canonical.com>" | |
import subprocess | |
import sys | |
import yaml |
import subprocess | |
logger = logging.getLogger(__name__) | |
def ensure_service_is_running(service): | |
def wrapper(callback): | |
def wrapped_f(self, *args, **kwargs): | |
try: | |
subprocess.check_call(["service", service, "stop"]) | |
callback(self, *args, **kwargs) |
//NewConfigFromFile function loads a YAML file and returns | |
//a pointer to a newly create Configuration struct | |
func NewConfigFromFile(path string) (*Config, error) { | |
cfg := New(Config) | |
if _, err := os.Stat(path); os.IsNotExist(err) { | |
return nil, errors.New("Cannot open configuration file") | |
} | |
readed, err := ioutil.ReadFile(path) |
def juju_status(juju_env=None): | |
cmd = ['juju', 'status'] | |
if juju_env: | |
cmd.append(['-e', juju_env]) | |
status_raw = subprocess.check_output(cmd) | |
return yaml.safe_load(status_raw) |
19<28@19niedbalski> neutron port-create --fixed-ip ip_address=10.5.0.x --security-group default wolsen_admin_net | |
19<28@19niedbalski> then, for each port ( neutron port-list ) | |
19<28@19niedbalski> neutron port-update 0d750378-8850-4bfb-9a9c-62bf3f69af8f --allowed_address_pairs list=true type=dict ip_address=10.5.0.x |