~nskaggs/juju-ci-tools/add-essential-operations

« back to all changes in this revision

Viewing changes to gotestwin.py

  • Committer: Curtis Hovey
  • Date: 2016-07-15 17:38:07 UTC
  • mto: (1505.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 1508.
  • Revision ID: curtis@canonical.com-20160715173807-j9o9c76y8ipx8ulu
Revisions per review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
def main(argv=None):
18
18
    parser = ArgumentParser()
19
19
    parser.add_argument('host', help='The machine to test on.')
20
 
    parser.add_argument('revision',
 
20
    parser.add_argument('revision_or_tarfile',
21
21
                        help='The revision-build or tarfile path to test.')
22
22
    parser.add_argument('package', nargs='?', default='github.com/juju/juju',
23
23
                        help='The package to test.')
24
24
    args = parser.parse_args(argv)
25
25
 
26
 
    if args.revision.endswith('tar.gz'):
27
 
        downloaded = args.revision
 
26
    if args.revision_or_tarfile.endswith('tar.gz'):
 
27
        downloaded = args.revision_or_tarfile
28
28
    else:
 
29
        revision = args.revision_or_tarfile
29
30
        juju_ci_path = join(SCRIPTS, 'jujuci.py')
30
31
        downloaded = subprocess.check_output([
31
 
            juju_ci_path, 'get', '-b', args.revision, 'build-revision',
 
32
            juju_ci_path, 'get', '-b', revision, 'build-revision',
32
33
            '*.tar.gz', './'])
33
34
        subprocess.check_call([
34
 
            juju_ci_path, 'get-build-vars', '--summary', args.revision])
 
35
            juju_ci_path, 'get-build-vars', '--summary', revision])
35
36
    (tarfile,) = [basename(l) for l in downloaded.splitlines()]
36
37
 
37
38
    with open('temp-config.yaml', 'w') as temp_file: