From 35b469a5ada7ab39a7849614d251f75c420d9720 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Sun, 31 Dec 2017 23:59:59 +0000 Subject: [PATCH] Remove trailing spaces in file xCAT-SoftLayer/bin/getslnodes.py --- xCAT-SoftLayer/bin/getslnodes.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xCAT-SoftLayer/bin/getslnodes.py b/xCAT-SoftLayer/bin/getslnodes.py index 51ee03662..b8b4b5334 100755 --- a/xCAT-SoftLayer/bin/getslnodes.py +++ b/xCAT-SoftLayer/bin/getslnodes.py @@ -5,11 +5,11 @@ Usage: getslnodes.py [-h] [-v] [] Description: Query your SoftLayer account and get attributes for each bare metal server. -The attributes can be piped to 'mkdef -z' to define the nodes into the xCAT -Database so that xCAT can manage them. +The attributes can be piped to 'mkdef -z' to define the nodes into the xCAT +Database so that xCAT can manage them. getslnodes requires a the .softlayer configuration file defined which can -be set by running "sl config setup" on the command line. +be set by running "sl config setup" on the command line. positional arguments: hostname-match Select servers that include this partial hostname. @@ -29,7 +29,7 @@ except ImportError as e: print 'Error: install missing python module before running this command: ' + str(e) sys.exit(2) -def get_sl_servers(): +def get_sl_servers(): # username, api_key, endpoint_url come from the .softlayer file client = SoftLayer.Client() @@ -44,9 +44,9 @@ def get_sl_servers(): # But those 2 operations are ANDed together, so it will not work. And currently, filtering does not work on fullyQualifiedDomainName. # servers = client['Account'].getHardware(mask=mask) - return servers - -def print_xcat_node_stanza(servers, hnmatch): + return servers + +def print_xcat_node_stanza(servers, hnmatch): for server in servers: if hnmatch and server['fullyQualifiedDomainName'].find(hnmatch) == -1: @@ -92,11 +92,11 @@ def print_xcat_node_stanza(servers, hnmatch): if __name__ == '__main__': try: - arguments = (docopt.docopt(__doc__, version="1.0")) + arguments = (docopt.docopt(__doc__, version="1.0")) # print arguments servers = get_sl_servers() - if arguments['--verbose']: + if arguments['--verbose']: pprint.pprint(servers) print_xcat_node_stanza(servers, arguments['']) @@ -106,6 +106,6 @@ if __name__ == '__main__': except SoftLayer.exceptions.SoftLayerAPIError as e: print e - sys.exit(1) + sys.exit(1)