~abentley/juju-ci-tools/more-logs

« back to all changes in this revision

Viewing changes to verify_mediawiki_bundle.py

  • Committer: Seman
  • Date: 2016-04-14 16:27:05 UTC
  • mfrom: (1358.1.1 fix-landscape-bundle)
  • Revision ID: seman.said@canonical.com-20160414162705-37kbz9y1unfoo30k
Updated landscape bundle verification to support haproxy being exposed by default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    return req
51
51
 
52
52
 
53
 
def verify_services(client, expected_services, scheme='http', text=None):
 
53
def verify_services(client, expected_services, scheme='http', text=None,
 
54
                    haproxy_exposed=False):
54
55
    status = client.get_status()
55
 
 
56
56
    if sorted(status.status['services']) != sorted(expected_services):
57
57
        raise JujuAssertionError('Unexpected service configuration: {}'.format(
58
58
            status.status['services']))
59
 
    if status.status['services']['haproxy']['exposed']:
60
 
        raise JujuAssertionError('haproxy is exposed.')
61
 
    client.juju('expose', ('haproxy',))
 
59
    if not haproxy_exposed:
 
60
        if status.status['services']['haproxy']['exposed']:
 
61
            raise JujuAssertionError('haproxy is exposed.')
 
62
        client.juju('expose', ('haproxy',))
62
63
    status = client.get_status()
63
64
    if not status.status['services']['haproxy']['exposed']:
64
65
        raise JujuAssertionError('haproxy is not exposed.')