~andrewjbeach/juju-ci-tools/get-juju-dict

« back to all changes in this revision

Viewing changes to assess_recovery.py

  • Committer: Curtis Hovey
  • Date: 2016-09-21 19:56:02 UTC
  • mfrom: (1610.2.1 wait-for-1x)
  • Revision ID: curtis@canonical.com-20160921195602-vjd0pyvvu4vs97br
Poll for the token, whcih might be None.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    configure_logging,
29
29
    JujuAssertionError,
30
30
    LoggedException,
 
31
    until_timeout,
31
32
)
32
33
 
33
34
 
41
42
 
42
43
 
43
44
def check_token(client, token):
44
 
    found = get_token_from_status(client)
45
 
    if token not in found:
46
 
        raise JujuAssertionError('Token is not {}: {}'.format(
47
 
            token, found))
 
45
    for ignored in until_timeout(300):
 
46
        found = get_token_from_status(client)
 
47
        if found and token in found:
 
48
            return found
 
49
    raise JujuAssertionError('Token is not {}: {}'.format(
 
50
                             token, found))
48
51
 
49
52
 
50
53
def deploy_stack(client, charm_series):