summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-11-05 15:03:13 -0600
committerGeorge Kraft <george.kraft@calxeda.com>2013-11-05 15:03:13 -0600
commitbcc088e727a5a3b8772a04b74e1bbee383412310 (patch)
treedeb02870448699e3860f04b41090ff7a2da99b7b
parent717ffbbd14a8669b32bb4056ba52f01b7f0c25b1 (diff)
downloadcxmanage-bcc088e727a5a3b8772a04b74e1bbee383412310.tar.gz
CXMAN-251: Clean up whitespace in tspackage output
-rw-r--r--cxmanage_api/cli/commands/tspackage.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/cxmanage_api/cli/commands/tspackage.py b/cxmanage_api/cli/commands/tspackage.py
index c10054a..e2663ba 100644
--- a/cxmanage_api/cli/commands/tspackage.py
+++ b/cxmanage_api/cli/commands/tspackage.py
@@ -174,16 +174,10 @@ def write_version_info(args, nodes):
for node in nodes:
- lines = [] # The lines of text to write to file
-
- # Since this is the first line of the file, we don't need a \n
- write_to_file(
- node,
+ lines = [
"[ Version Info for Node %d ]" % node.node_id,
- add_newlines=False
- )
-
- lines.append("ECME IP Address : %s" % node.ip_address)
+ "ECME IP Address : %s" % node.ip_address
+ ]
if node in info_results:
info_result = info_results[node]
@@ -440,9 +434,7 @@ def write_to_file(node, to_write, add_newlines=True):
"""
with open("node" + str(node.node_id) + ".txt", 'a') as node_file:
if add_newlines:
- # join() doesn't add a newline before the first item
- to_write[0] = "\n" + to_write[0]
- node_file.write("\n".join(to_write))
+ node_file.write("%s\n" % "\n".join(to_write))
else:
node_file.write("".join(to_write))