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?
This commit is contained in:
@@ -13,6 +13,7 @@ direcotry.
|
|||||||
|
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
@@ -46,9 +47,10 @@ for suffix in suffixes:
|
|||||||
subprocess.check_call(['zip', '-rq', filename, dirname])
|
subprocess.check_call(['zip', '-rq', filename, dirname])
|
||||||
shutil.rmtree(dirname)
|
shutil.rmtree(dirname)
|
||||||
|
|
||||||
upload_url = upload_base + filename
|
if '--upload' in sys.argv:
|
||||||
print('Uploading: ' + upload_url)
|
upload_url = upload_base + filename
|
||||||
cmd = ['gsutil', 'cp', '-n', filename, upload_url]
|
print('Uploading: ' + upload_url)
|
||||||
print(' '.join(cmd))
|
cmd = ['gsutil', 'cp', '-n', filename, upload_url]
|
||||||
subprocess.check_call(cmd)
|
print(' '.join(cmd))
|
||||||
os.remove(filename)
|
subprocess.check_call(cmd)
|
||||||
|
os.remove(filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user