From: Tony Mack Date: Fri, 11 Nov 2011 05:10:05 +0000 (-0500) Subject: nodes are Node objects X-Git-Tag: sfa-1.1-3~35 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d37a5fc0cec9499ef9582eec8738fc3635cf9fbb;p=sfa.git nodes are Node objects --- diff --git a/sfa/client/sfiListNodes.py b/sfa/client/sfiListNodes.py index 29fc80d0..3de1657f 100755 --- a/sfa/client/sfiListNodes.py +++ b/sfa/client/sfiListNodes.py @@ -19,9 +19,7 @@ if command.opts.infile: for node in nodes: hostname = None - if node.get('component_name'): - hostname = node['component_name'] - elif node.get('component_id'): + if node.get('component_id'): hostname = xrn_to_hostname(node['component_id']) if hostname: print hostname diff --git a/sfa/client/sfiListSlivers.py b/sfa/client/sfiListSlivers.py index cf76823f..c869f614 100755 --- a/sfa/client/sfiListSlivers.py +++ b/sfa/client/sfiListSlivers.py @@ -3,6 +3,7 @@ import sys from sfa.client.sfi_commands import Commands from sfa.rspecs.rspec import RSpec +from sfa.util.plxrn import xrn_to_hostname command = Commands(usage="%prog [options]", description="List all slivers in the RSpec. " + @@ -23,10 +24,14 @@ if command.opts.infile: print " %s: %s" % (name, value) for node in nodes: - print node - if command.opts.showatt: - atts = rspec.version.get_sliver_attributes(node) - for (name, value) in atts: - print " %s: %s" % (name, value) + hostname = None + if node.get('component_id'): + hostname = xrn_to_hostname(node['component_id']) + if hostname: + print hostname + if command.opts.showatt: + atts = rspec.version.get_sliver_attributes(hostname) + for (name, value) in atts: + print " %s: %s" % (name, value)