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="Delete slivers from the RSpec. " +
9 "This command reads in an RSpec and outputs a modified " +
10 "RSpec. Use this to remove nodes from your slice.")
11 command.add_nodefile_option()
14 if command.opts.infile:
15 rspec = parse_rspec(command.opts.infile)
17 if command.opts.nodefile:
18 f = open(command.opts.nodefile, "r")
19 nodes = f.read().split()
23 slivers = [{'hostname': node} for node in nodes]
24 rspec.remove_slivers(slivers)
26 print >> sys.stderr, "FAILED: %s" % nodes