Skip to content

Instantly share code, notes, and snippets.

View adam-stokes's full-sized avatar
🦧

Adam Stokes adam-stokes

🦧
  • North Carolina
  • 23:26 (UTC -04:00)
View GitHub Profile
@adam-stokes
adam-stokes / c.py
Created May 25, 2017 22:31 — forked from johnsca/c.py
proof-of-concept async subprocess file tail
#!/usr/bin/python3
import asyncio
import aiofiles
import textwrap
consumer = textwrap.dedent(
"""
for i in {1..5}; do
ubuntu@zohan:~$ juju status --format yaml --logging-config TRACE --debug
16:10:39 INFO juju.cmd supercommand.go:63 running juju [2.2-rc1 gc go1.8]
16:10:39 DEBUG juju.cmd supercommand.go:64 args: []string{"/snap/conjure-up/321/bin/juju", "status", "--format", "yaml", "--logging-config", "TRACE", "--debug"}
16:10:39 INFO juju.juju api.go:73 connecting to API addresses: [162.213.33.28:443 162.213.33.250:443]
16:10:40 DEBUG juju.api apiclient.go:705 error dialing websocket: x509: cannot validate certificate for 162.213.33.28 because it doesn't contain any IP SANs
16:10:40 DEBUG juju.api apiclient.go:705 error dialing websocket: x509: cannot validate certificate for 162.213.33.250 because it doesn't contain any IP SANs
ERROR unable to connect to API: x509: cannot validate certificate for 162.213.33.250 because it doesn't contain any IP SANs
16:10:40 DEBUG cmd supercommand.go:459 error stack:
x509: cannot validate certificate for 162.213.33.250 because it doesn't contain any IP SANs
github.com/juju/juju/api/a
ubuntu@zohan:~$ juju version
2.2-rc1-xenial-amd64
ubuntu@zohan:~$ juju status --format yaml
ERROR unable to connect to API: x509: cannot validate certificate for 162.213.33.250 because it doesn't contain any IP SANs
ubuntu@zohan:~$ juju controllers
Use --refresh flag with this command to see the latest information.
Controller Model User Access Cloud/Region Models Machines HA Version
jaas* conjure-up-kubernetes-core-56e adam-stokes@external (unknown) - - - 2.1.2
2017-05-22 16:00:35,086 [DEBUG] conjure-up/canonical-kubernetes - events.py:50 - Setting Error at conjureup/events.py:133
2017-05-22 16:00:35,087 [ERROR] conjure-up/canonical-kubernetes - events.py:141 - Unhandled exception
Traceback (most recent call last):
File "/snap/conjure-up/321/lib/python3.6/site-packages/conjureup/events.py", line 139, in handle_exception
raise exc
File "/snap/conjure-up/321/lib/python3.6/site-packages/conjureup/controllers/bootstrap/common.py", line 56, in do_bootstrap
app.current_cloud)
File "/snap/conjure-up/321/lib/python3.6/site-packages/conjureup/juju.py", line 768, in add_model
"Unable to create model: {}".format(stderr.decode('utf8')))
Exception: Unable to create model: ERROR opening API connection: unable to connect to API: x509: cannot validate certificate for 162.213.33.250 because it doesn't contain any IP SANs
In the conjure-up world we span multiple substrates to install big software. One of the most popular substrate is our Localhost(LXD) provider. It is also one of the main source of bug reports we get due to LXD configuration and installation issues. This is further complicated because on Ubuntu Xenial 16.04 you can have multiple LXD's running at the same time via `apt install` or `snap install`.
A lot of our issues come in the form of the following:
* A user has previously setup LXD and then attempted to run conjure-up against it. A problem we ran into here are with custom zfs storage options.
* Users who have previously installed the initial debian package of conjure-up which setup some custom LXD bridges for use with our single machine OpenStack deployments which leads to the next point.
* A user has upgraded from LXD 2.0.9 to the PPA version of 2.13 (at the time of this writing) and has several bridges and and the migration from using `/etc/default/lxd-bridge` to managing that within LXD itself.
""" management command for adding vendor seed data
"""
# pylint: disable=no-member
```
services:
easyrsa:
charm: "cs:~containers/easyrsa-8"
num_units: 1
annotations:
"gui-x": "450"
"gui-y": "550"
to:
- "0"
make[4]: Entering directory '/home/adam/Projects/conjure-up/parts/lxc/build/src/lxc'
/bin/mkdir -p '/home/adam/Projects/conjure-up/parts/lxc/install/bin'
/usr/bin/install -c lxc-attach lxc-autostart lxc-cgroup lxc-checkpoint lxc-copy lxc-config lxc-console lxc-create lxc-destroy lxc-device lxc-execute lxc-freeze lxc-info lxc-ls lxc-monitor lxc-snapshot lxc-start lxc-stop lxc-top lxc-unfreeze lxc-unshare lxc-usernsexec lxc-wait '/home/adam/Projects/conjure-up/parts/lxc/install/bin'
/bin/mkdir -p '/home/adam/Projects/conjure-up/parts/lxc/install/bin'
/usr/bin/install -c tools/lxc-checkconfig '/home/adam/Projects/conjure-up/parts/lxc/install/bin'
/bin/mkdir -p '/home/adam/Projects/conjure-up/parts/lxc/install/lib'
/usr/bin/install -c liblxc.so '/home/adam/Projects/conjure-up/parts/lxc/install/lib'
mkdir -p /home/adam/Projects/conjure-up/parts/lxc/install/share/lxc
install -c -m 644 lxc.functions /home/adam/Projects/conjure-up/parts/lxc/install/share/lxc
fatal: Not a git repository (or any of the parent d
Hit:1 http://archive.ubuntu.com/ubuntu zesty InRelease
Get:2 http://archive.ubuntu.com/ubuntu zesty-updates InRelease [89.2 kB]
Hit:3 http://archive.ubuntu.com/ubuntu zesty-backports InRelease
Get:4 http://archive.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]
Fetched 178 kB in 0s (222 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
[adam:~] $ juju set-default-region aws eu-central-1
Default region in aws set to "eu-central-1".
[adam:~] $ juju clouds
Cloud Regions Default Type Description
aws 14 us-east-1 ec2 Amazon Web Services
[adam:~] $ cat .local/share/juju/clouds.yaml
clouds:
conjure-cloud-maas-82b:
type: maas
auth-types: [oauth1]