~tyler-baker/lava-lab/setup-before-upgrade

« back to all changes in this revision

Viewing changes to scripts/lava-status

  • 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.info.__doc__)
 
10
    parser.add_argument('instance', metavar='<instance>',
 
11
                        help='The instance name to stop')
 
12
    args = parser.parse_args()
 
13
 
 
14
    client = lava_salt.salt_client()
 
15
 
 
16
    for host, props in lava_salt.info(client, args.instance).iteritems():
 
17
        running = lava_salt.STATE_STRING[props['running']]
 
18
        master = props['master']
 
19
        print '{0}: running({1}) master({2})'.format(host, running, master)