4 from sfa.client.sfi_commands import Commands
5 from sfa.rspecs.rspec_parser import parse_rspec
7 command = Commands(usage="%prog [options] node1 node2...",
8 description="Add slivers to the RSpec. " +
9 "This command reads in an RSpec and outputs a modified " +
10 "RSpec. Use this to add nodes to your slice.")
11 command.add_nodefile_option()
14 if not command.opts.nodefile:
15 print "Missing node list -- exiting"
16 command.parser.print_help()
19 if command.opts.infile:
20 infile=file(command.opts.infile)
23 if command.opts.outfile:
24 outfile=file(command.opts.outfile,"w")
28 rspec = parse_rspec(infile)
29 nodes = file(command.opts.nodefile).read().split()
31 rspec.add_slivers(nodes)
33 print >> sys.stderr, "FAILED: %s" % nodes
34 print >>outfile, rspec.toxml()