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
[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
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)
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-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
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
@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')
host = juju.unit_get("private-address")
port=8181
juju.relation_set({
'hostname':host, 'port':port})
2016-02-18 11:12:30 DEBUG juju.state open.go:52 dialing mongo
2016-02-18 11:12:30 DEBUG juju.worker.dependency engine.go:450 "upgradewaiter" manifold worker started
2016-02-18 11:12:30 DEBUG juju.worker.dependency engine.go:464 "logging-config-updater" manifold worker stopped: dependency not available
2016-02-18 11:12:30 DEBUG juju.worker.dependency engine.go:464 "apiworkers" manifold worker stopped: dependency not available
2016-02-18 11:12:30 DEBUG juju.worker.dependency engine.go:464 "reboot" manifold worker stopped: dependency not available
2016-02-18 11:12:30 INFO juju.mongo open.go:125 dialled mongo successfully on address "127.0.0.1:37017"
2016-02-18 11:12:30 DEBUG juju.worker.peergrouper worker.go:432 found new machine "0"
2016-02-18 11:12:30 INFO juju.apiserver apiserver.go:298 [7] API connection from 81.174.164.218:55112, active connections: 2
2016-02-18 11:12:30 DEBUG juju.apiserver utils.go:70 validate model uuid: controller model - f76edc4c-761d-4859-88fd-046e54aa0b84
2016-02-18 11:12:30 DEBUG ju
@buggtb
buggtb / gist:7bdface06dd29a053c97
Last active January 26, 2016 20:40 — forked from madis/gist:4650014
Testing CORS OPTIONS request with curl
curl \
--verbose \
--request OPTIONS \
http://81.174.164.218:8181/cxf/rest/core/user \
--header 'Origin: http://localhost:9292' \
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \
--header 'Access-Control-Request-Method: GET'
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE
<Schema name="FoodMart Test" missingLink="ignore" metamodelVersion="4.300">
<PhysicalSchema>
<Table name="sales_fact_1997" alias="sales_fact_1997">
<ColumnDefs>
<CalculatedColumnDef name="calc$9" type="Numeric">
<ExpressionView>
<SQL dialect="mysql">
<![CDATA[extract(YEAR from the_date)]]>
</SQL>
</ExpressionView>