now uses new RSpec libraries
[sfa.git] / sfa / client / sfiListNodes.py
1 #! /usr/bin/env python
2
3 import sys
4 #from sfa.util.rspecHelper import RSpec, Commands
5 from sfa.client.sfi_commands import Commands
6 from sfa.rspecs.rspec_parser import parse_rspec 
7
8 command = Commands(usage="%prog [options]",
9                    description="List all nodes in the RSpec. " + 
10                    "Use this to display the list of nodes on which it is " + 
11                    "possible to create a slice.")
12 command.prep()
13
14 if command.opts.infile:
15     rspec = parse_rspec(command.opts.infile)
16     nodes = rspec.get_nodes()
17     if command.opts.outfile:
18         sys.stdout = open(command.opts.outfile, 'w')
19     
20     for node in nodes:
21         print node
22
23
24
25