We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f33e4e commit 62cd9d2Copy full SHA for 62cd9d2
hardware/raspberrypi/bootmodes/pxetools/pxetools
@@ -55,6 +55,11 @@ def add():
55
else:
56
serial = sys.argv[2]
57
58
+ # Validate serial
59
+ serial = serial.lstrip("0")
60
+ if not re.search("^[0-9a-f]{8}$", serial):
61
+ raise Exception("Invalid serial number {}".format(serial))
62
+
63
print("Serial: {}".format(serial))
64
owner = input("Owner Name (ex Gordon): ")
65
name = input("Name for pi: ")
@@ -66,11 +71,6 @@ def add():
66
71
67
72
img_choice = input("Enter an option number: ")
68
73
69
- # Validate stuff
70
- serial = serial.lstrip("0")
- if not re.search("^[0-9a-f]{8}$", serial):
- raise Exception("Invalid serial number {}".format(serial))
-
74
tftp_path = "/tftpboot/{}".format(serial)
75
nfs_path = "/nfs/{}".format(serial)
76
if os.path.exists(tftp_path):
0 commit comments