Skip to content

Commit

Permalink
Merge pull request #553 from DavidSpickett/fix-username
Browse files Browse the repository at this point in the history
Fix UnboundLocalError for username when testing multiple learning path pages
  • Loading branch information
pareenaverma authored Oct 31, 2023
2 parents e3e543b + 08e1dee commit ec0f854
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ def check(json_file, start, stop):
subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)

# Create user and configure
username="user"
if "arm-tools" in img:
username="ubuntu"
# These images already have a 'ubunutu' user account set up.
cmd = ["docker exec test_{} apt update".format(i)]
logging.debug(cmd)
subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
Expand Down Expand Up @@ -210,6 +209,7 @@ def check(json_file, start, stop):
else:
inst = range(0, len(data["image"]))

username = "ubuntu" if "arm-tools" in data["image"][0] else "user"
for k in inst:
# Copy over the file with commands
cmd = ["docker cp {} test_{}:/home/{}/".format(fn, k, username)]
Expand Down

0 comments on commit ec0f854

Please sign in to comment.