~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to wait_for_agent_update.py

  • Committer: Aaron Bentley
  • Date: 2014-02-28 16:40:22 UTC
  • mto: This revision was merged to the branch mainline in revision 257.
  • Revision ID: aaron.bentley@canonical.com-20140228164022-kfip2tphn9m9invi
Add juju-backup script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
 
from __future__ import print_function
 
2
__metaclass__ = type
3
3
 
4
4
from jujupy import Environment
5
5
 
 
6
from collections import defaultdict
6
7
import sys
7
8
 
8
9
 
9
 
__metaclass__ = type
10
 
 
11
 
 
12
10
def agent_update(environment):
13
11
    env = Environment.from_config(environment)
14
12
    env.wait_for_version(env.get_matching_agent_version())
16
14
 
17
15
def main():
18
16
    try:
19
 
        agent_update(sys.argv[1])
 
17
       agent_update(sys.argv[1])
20
18
    except Exception as e:
21
 
        print(e)
 
19
        print e
22
20
        sys.exit(1)
23
21
 
24
22