Skip to content

Commit eda31dc

Browse files
authored
Only upload node with gsutil in update_node.py if --upload is passed. (#1472)
This allows running the script locally. Is there some kind of automated script that needs a matching update, or was this always run manually?
1 parent dc6e0d4 commit eda31dc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

scripts/update_node.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import urllib.request
1515
import subprocess
16+
import sys
1617
import os
1718
import shutil
1819

@@ -46,9 +47,10 @@
4647
subprocess.check_call(['zip', '-rq', filename, dirname])
4748
shutil.rmtree(dirname)
4849

49-
upload_url = upload_base + filename
50-
print('Uploading: ' + upload_url)
51-
cmd = ['gsutil', 'cp', '-n', filename, upload_url]
52-
print(' '.join(cmd))
53-
subprocess.check_call(cmd)
54-
os.remove(filename)
50+
if '--upload' in sys.argv:
51+
upload_url = upload_base + filename
52+
print('Uploading: ' + upload_url)
53+
cmd = ['gsutil', 'cp', '-n', filename, upload_url]
54+
print(' '.join(cmd))
55+
subprocess.check_call(cmd)
56+
os.remove(filename)

0 commit comments

Comments
 (0)