4 from sfa.util.rspecHelper import RSpec, Commands
6 command = Commands(usage="%prog [options] [node1 node2...]",
7 description="Add sliver attributes to the RSpec. " +
8 "This command reads in an RSpec and outputs a modified " +
9 "RSpec. Use this to add attributes to individual nodes " +
10 "in your slice. If no nodes are specified, the " +
11 "attributes will be added to ALL nodes.",
12 epilog="NOTE: Only admins can actually set these " +
13 "attributes, with the exception of --delegations")
14 command.add_nodefile_option()
15 command.add_attribute_options()
18 attrs = command.get_attribute_dict()
20 for value in attrs[name]:
23 command.rspec.add_default_sliver_attribute(name, value)
25 print >> sys.stderr, "FAILED: on all nodes: %s=%s" % (name, value)
27 for node in command.nodes:
29 command.rspec.add_sliver_attribute(node, name, value)
31 print >> sys.stderr, "FAILED: on node %s: %s=%s" % (node, name, value)