Last change
on this file since 12306 was 10566, checked in by richardvm, 13 years ago |
fixed credits
|
-
Property svn:executable
set to
*
|
File size:
673 bytes
|
Rev | Line | |
---|
[10565] | 1 | #!/usr/bin/env python
|
---|
| 2 | #
|
---|
[10566] | 3 | # Script to output (stdout) a list of active nodes
|
---|
| 4 | #
|
---|
| 5 | # Credits:
|
---|
| 6 | # Richard van Mansom <richardvm@wirelessleiden.nl>
|
---|
[10565] | 7 | # Rick van der Zwet <rick@wirelessleiden.nl>
|
---|
| 8 |
|
---|
| 9 | import gformat
|
---|
| 10 |
|
---|
| 11 | def is_iris(node):
|
---|
| 12 | return node.has_key('release') and node['release'] in ['8.0-RELEASE', '7.2-RELEASE', '8.1-RELEASE', '8.2-RELEASE', '9.0-RELEASE']
|
---|
| 13 |
|
---|
| 14 | def is_up(datadump):
|
---|
| 15 | return datadump['status'] == 'up'
|
---|
| 16 |
|
---|
| 17 | if __name__ == '__main__':
|
---|
| 18 | # Process all hosts
|
---|
| 19 | for host in gformat.get_hostlist():
|
---|
| 20 | datadump = gformat.get_yaml(host)
|
---|
| 21 |
|
---|
| 22 | # Make sure to process only active IRIS nodes
|
---|
| 23 | if not is_iris(datadump) or not is_up(datadump):
|
---|
| 24 | continue
|
---|
| 25 |
|
---|
| 26 | print host
|
---|
| 27 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.