5 from sfa.util.sfalogging import logger
6 from sfa.client.sfi_commands import Commands
7 from sfa.rspecs.rspec import RSpec
9 logger.enable_console()
10 command = Commands(usage="%prog [options] node1 node2...",
11 description="Delete slivers from the RSpec. " +
12 "This command reads in an RSpec and outputs a modified " +
13 "RSpec. Use this to remove nodes from your slice.")
14 command.add_nodefile_option()
17 if command.opts.infile:
18 rspec = RSpec(command.opts.infile)
20 if command.opts.nodefile:
21 f = open(command.opts.nodefile, "r")
22 nodes = f.read().split()
26 slivers = [{'hostname': node} for node in nodes]
27 rspec.version.remove_slivers(slivers)
30 logger.log_exc("sfiDeleteSliver FAILED with nodes %s" % nodes)