Skip to content

Instantly share code, notes, and snippets.

View buggtb's full-sized avatar
🎯
Urgh..Why can't I set all my statuses in one place?

Tom Barber buggtb

🎯
Urgh..Why can't I set all my statuses in one place?
View GitHub Profile
host = juju.unit_get("private-address")
port=8181
juju.relation_set({
'hostname':host, 'port':port})
@when('leadership.is_leader')
def add_leader_config():
render_master_config()
@when_not('leadership.is_leader')
def add_slave_config():
render_slave_config()
@when('leadership.changed')
2016-03-02 15:29:11 INFO juju-log Reactive main running for hook update-status
2016-03-02 15:29:12 INFO juju-log Initializing Leadership Layer (is leader)
2016-03-02 15:29:12 INFO juju-log Invoking reactive handler: reactive/pdi.py:43:check_running
2016-03-02 15:29:13 INFO juju-log Invoking reactive handler: reactive/pdi.py:119:update_master_config
2016-03-02 15:29:13 INFO juju-log Writing file /opt/data-integration/pwd/carte-config.xml root:root 444
2016-03-02 15:29:15 INFO juju-log Invoking reactive handler: reactive/pdi.py:111:change_leader
2016-03-02 15:24:22 INFO juju-log java:3: Making dir /home/etl root:root 555
2016-03-02 15:29:11 INFO juju-log Reactive main running for hook update-status
2016-03-02 15:29:12 INFO juju-log Initializing Leadership Layer (is leader)
2016-03-02 15:29:12 INFO juju-log Invoking reactive handler: reactive/pdi.py:43:check_running
2016-03-02 15:29:13 INFO juju-log Invoking reactive handler: reactive/pdi.py:119:update_master_config
2016-03-02 15:29:13 INFO juju-log Writing file /opt/data-integration/pwd/carte-config.xml root:root 444
2016-03-02 15:29:15 INFO juju-log Invoking reactive handler: reactive/pdi.py:111:change_leader
2016-03-02 15:34:11 INFO juju-log Reactive main running for hook update-status
2016-03-02 15:34:12 INFO juju-log Initializing Leadership Layer (is leader)
2016-03-02 15:34:12 INFO juju-log Invoking reactive handler: reactive/pdi.py:119:update_master_config
import os
import stat
from shutil import rmtree, chown
from subprocess import check_call, CalledProcessError, call, check_output
from charmhelpers.core import hookenv
from charmhelpers.core.hookenv import status_set
from charmhelpers.core.host import adduser, chownr, mkdir
from charmhelpers.fetch.archiveurl import ArchiveUrlFetchHandler
from charms.reactive import when, when_not, set_state, remove_state, is_state
2016-03-04 10:02:15 INFO juju-log Reactive main running for hook config-changed
2016-03-04 10:02:15 INFO juju-log Initializing Leadership Layer (is leader)
2016-03-04 10:02:16 INFO juju-log Invoking reactive handler: reactive/pdi.py:49:check_running
2016-03-04 10:02:16 INFO juju-log altering carte password to: changeme8
2016-03-04 10:02:30 INFO juju-log encrypted password is: OBF:1ju21toi1tv71uvc1tvj1uuu1tvv1toc1jro
2016-03-04 10:02:30 INFO juju-log config changed, carte needs to be restarted
2016-03-04 10:02:31 INFO juju-log Invoking reactive handler: reactive/pdi.py:89:change_leader
2016-03-04 10:02:32 INFO juju-log Writing file /home/etl/carte-config.xml root:root 444
2016-03-04 10:07:15 INFO juju-log Reactive main running for hook update-status
2016-03-04 10:07:15 INFO juju-log Initializing Leadership Layer (is leader)
[Units]
ID WORKLOAD-STATE AGENT-STATE VERSION MACHINE PORTS PUBLIC-ADDRESS MESSAGE
pdi/29 active idle 2.0-beta1 36 9999/tcp 52.28.90.178 Carte is ready! Master is:52.28.90.178
openjdk/4 active idle 2.0-beta1 52.28.90.178 OpenJDK 7 (jre) installed
#!/usr/bin/env python3
import unittest
import amulet
class TestDeploy(unittest.TestCase):
"""
Deployment test for the Pentaho Data Integration charm.
units:
pdi/0:
workload-status:
current: active
message: Carte is ready! Master is:52.49.141.21
since: 14 Mar 2016 23:43:26Z
agent-status:
current: idle
since: 14 Mar 2016 23:43:29Z
version: 1.24.7
type=OLAP
name=dsname
driver=mondrian.olap4j.MondrianOlap4jDriver
location=jdbc:xmla:Server=http://test
username=sa
password=password
security.enabled=true
security.type=passthrough