~tyler-baker/lava-lab/latest-minion

« back to all changes in this revision

Viewing changes to scripts/lava-add-worker

  • Committer: Andy Doan
  • Date: 2013-02-08 04:41:31 UTC
  • mto: This revision was merged to the branch mainline in revision 68.
  • Revision ID: andy.doan@linaro.org-20130208044131-92ukqd5s542qqbrp
add some lava scripts to help manage lab

lava-status - shows the nodes contributing to a lava deployment, if
they are running, and which is the master instance

lava-{start/stop} - start/stop each lava-instance contributing to a lava deployment

lava-upgrade - performs an upgrade for a lava-deployment

lava-addworker - add support for installing a remote worker instance

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
import argparse
 
4
 
 
5
import lava_salt
 
6
 
 
7
 
 
8
if __name__ == '__main__':
 
9
    parser = argparse.ArgumentParser(description=lava_salt.add_worker.__doc__)
 
10
    parser.add_argument('minion', metavar='<minion>',
 
11
                        help='The host to install the lava worker instance on.')
 
12
    parser.add_argument('ip', metavar='<ip>',
 
13
                        help='The public IP address for the minion.')
 
14
    parser.add_argument('instance', metavar='<instance>',
 
15
                        help='The instance name we are creating on the worker')
 
16
    parser.add_argument('--dry-run', dest='dryrun', action='store_true',
 
17
                        help='Just display what would be changed')
 
18
    args = parser.parse_args()
 
19
 
 
20
    client = lava_salt.salt_client()
 
21
    ret = lava_salt.add_worker(client, args.minion, args.ip, args.instance, args.dryrun)
 
22
    print ret[args.minion]