How to use the juju.delta.ApplicationDelta function in juju

To help you get started, we’ve selected a few juju examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github juju-solutions / matrix / tests / chaos / test_main.py View on Github external
def make_test_model(foo_unit=True, foo_status='idle'):
    juju_model = Model()
    state = juju_model.state
    state.apply_delta(ApplicationDelta(
        ('application', 'type2', {'name': 'foo'})))
    if foo_unit:
        state.apply_delta(UnitDelta(('unit', 'type1', {
            'name': 'steve',
            'application': 'foo',
            # Add some status to fake out chaos's "wait 'til the
            # cloud is idle" check.
            'agent-status': {'current': foo_status}
            })))
    return juju_model