~sinzui/juju-ci-tools/cloudsigma-lib

« back to all changes in this revision

Viewing changes to deploy_stack.py

  • Committer: Nate Finch
  • Date: 2015-06-02 03:47:22 UTC
  • mfrom: (968 origin/trunk)
  • mto: This revision was merged to the branch mainline in revision 976.
  • Revision ID: nate.finch@canonical.com-20150602034722-cr3lzq2yb6xdh7gz
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
381
381
def add_path_args(parser):
382
382
    parser.add_argument('--new-juju-bin', default=None,
383
383
                        help='Dirctory containing the new Juju binary.')
384
 
    parser.add_argument('--run-startup', help='Run common-startup.sh.',
385
 
                        action='store_true', default=False)
386
384
 
387
385
 
388
386
def add_output_args(parser):
402
400
 
403
401
 
404
402
def get_juju_path(args):
405
 
    if args.run_startup:
406
 
        env = dict(os.environ)
407
 
        env.update({
408
 
            'ENV': args.env,
409
 
        })
410
 
        scripts = os.path.dirname(os.path.abspath(sys.argv[0]))
411
 
        subprocess.check_call(
412
 
            ['bash', '{}/common-startup.sh'.format(scripts)], env=env)
413
 
        bin_path = subprocess.check_output(['find', 'extracted-bin', '-name',
414
 
                                            'juju']).rstrip('\n')
415
 
        juju_path = os.path.abspath(bin_path)
416
 
    elif args.new_juju_bin is None:
417
 
        raise Exception('Either --new-juju-bin or --run-startup must be'
418
 
                        ' supplied.')
419
 
    else:
420
 
        juju_path = os.path.join(args.new_juju_bin, 'juju')
 
403
    juju_path = os.path.join(args.new_juju_bin, 'juju')
421
404
    return juju_path
422
405
 
423
406
 
601
584
                        help='The juju environment to test')
602
585
    parser.add_argument('logs', help='log directory.')
603
586
    parser.add_argument('job_name', help='Name of the Jenkins job.')
 
587
    parser.add_argument('--bundle-name', default=None,
 
588
                        help='Name of the bundle to deploy.')
604
589
    add_juju_args(parser)
605
590
    add_output_args(parser)
606
591
    add_path_args(parser)
619
604
    if host is None:
620
605
        raise Exception('Could not get machine 0 host')
621
606
    try:
622
 
        client.deployer(args.bundle_path)
 
607
        client.deployer(args.bundle_path, args.bundle_name)
623
608
    except BaseException as e:
624
609
        logging.exception(e)
625
610
        if host is not None: