Skip to content

Instantly share code, notes, and snippets.

View TheRealFalcon's full-sized avatar

James Falcon TheRealFalcon

  • Canonical
  • Kenosha, WI
View GitHub Profile
#!/bin/bash
echo "test" > /var/tmp/test
from argparse import ArgumentParser
from typing import Dict, Type
from pycloudlib.cloud import BaseCloud
from pycloudlib.azure.cloud import Azure
from pycloudlib.ec2.cloud import EC2
from pycloudlib.gce.cloud import GCE
from pycloudlib.lxd.cloud import LXDContainer, LXDVirtualMachine
from pycloudlib.oci.cloud import OCI
from pycloudlib.openstack.cloud import Openstack

I have been trying to understand the behavior of apply_network_config in stages.py.

When trying to update the code to support configrable EventTypes, I noticed that we sometimes apply networking configuration twice.

apply_network_config only has two call points, both in main.py. The happy-path call gets called twice, once during local phase, then again during network phase.

Inside of the function, there is some logic to determine if we should apply networking config. One of these calls is self.is_new_instance(), which is a bit of a misnomer. It only returns True during the first local run. During the network phase run (still on first boot), it will return False.

Prior to the introduction of EventTypes (e.g., [commit 58581362](https://github.com/canonical/cloud-ini

@TheRealFalcon
TheRealFalcon / build.gradle
Created June 29, 2017 14:59
Simple gradle example
plugins {
id 'java'
id 'java-library'
id 'application'
id "com.github.johnrengelman.shadow" version "2.0.1"
}
group 'falcon'
version '1.0-SNAPSHOT'