Skip to content

Instantly share code, notes, and snippets.

View ajkavanagh's full-sized avatar

Alex Kavanagh ajkavanagh

View GitHub Profile
import Control.Applicative (Applicative(..))
import Control.Monad (liftM, ap)
-- MyMaybe is to play with Maybes
data MyMaybe x = MyJust x | MyNothing
deriving Show
-- Monad MyMabye
instance Functor MyMaybe where

(Trying) to Configure a project to just be a deployment guide with Zuul v3

This is now overtaken by events and is being retained for interest and understanding how things work with Zuul v3.

Background

The charms deployment guide for OpenStack is an 'odd' OpenStack project, in that it contains only a deployment guide; no documents, or other code.

Dependencies in Reactive charms

Introduction

In the OpenStack team, and potentially elsewhere, there is a need to maintain stable as well as devel charms. With non-reactive charms, this is fairly simple.

However, with reactive charms, when a charm is rebuilt the dependencies are taken from the master branch of the various layers and interfaces, and the

package main
import (
"fmt"
)
// Accumulate takes a []string, applies func f to each
// element and returns the resulting []string.
func Accumulate(s []string, f func(string) string) []string {
for i := range s {
# FIRST make sure you find all of the code that might call service_start(), service_restart() or service_reload()
# I use:
# ack "service_(restart|start|reload)" --ignore-dir=charmhelpers --ignore-dir=trusty --ignore-dir=unit_tests --ignore-dir=.tox
# This will provide a list of files/locations that definitely need a "if not is_unit_paused_set():" type stanze.
# 0. Sync charm-helpers to the latest version - it includes the code thats needed for
# maintenance mode (pause/resume).
# 1. Change the charm’s xxx_utils.py file (in lib/ or hooks/)

Keybase proof

I hereby claim:

  • I am ajkavanagh on github.
  • I am ajkavanagh (https://keybase.io/ajkavanagh) on keybase.
  • I have a public key ASDCmApt7bjxCr-3SDhgut-HZxXGdGwZO_iJNuJAzMPsTAo

To claim this, I am signing this object:

@ajkavanagh
ajkavanagh / gist:7237185
Last active December 27, 2015 00:19 — forked from gotbadger/gist:4979243
#!/bin/bash
# setup local
BIND_ADAPTER="en0"
LOCAL_PORT=4000
# setup remote
REMOTE_USER="user"
REMOTE_HOST="server.example.com"
REMOTE_PORT=9999