Skip to content

Commit

Permalink
[show]: Append username to temporary template filenames to prevent in…
Browse files Browse the repository at this point in the history
…ter-user issues (sonic-net#81)
  • Loading branch information
jleveque authored Jul 17, 2017
1 parent 08c1fae commit 69b0184
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import click
import errno
import getpass
import os
import subprocess
import sys
Expand Down Expand Up @@ -269,9 +270,9 @@ def platform():
@platform.command()
def summary():
"""Show hardware platform information"""
click.echo("")
username = getpass.getuser()

PLATFORM_TEMPLATE_FILE = "/tmp/cli_platform.j2"
PLATFORM_TEMPLATE_FILE = "/tmp/cli_platform_{0}.j2".format(username)
PLATFORM_TEMPLATE_CONTENTS = "Platform: {{ platform }}\n" \
"HwSKU: {{ minigraph_hwsku }}\n" \
"ASIC: {{ asic_type }}"
Expand Down Expand Up @@ -326,9 +327,9 @@ def logging(process, lines, follow):
@cli.command()
def version():
"""Show version information"""
click.echo("")
username = getpass.getuser()

VERSION_TEMPLATE_FILE = "/tmp/cli_version.j2"
VERSION_TEMPLATE_FILE = "/tmp/cli_version_{0}.j2".format(username)
VERSION_TEMPLATE_CONTENTS = "SONiC Software Version: SONiC.{{ build_version }}\n" \
"Distribution: Debian {{ debian_version }}\n" \
"Kernel: {{ kernel_version }}\n" \
Expand Down

0 comments on commit 69b0184

Please sign in to comment.