Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaeno committed Mar 29, 2023
1 parent c9c3c99 commit a2b38b0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
** Release Notes

1.5.42
* added retry when checking sandbox files created by cpack

1.5.41
* added secret-related methods to JobSpec

Expand Down
2 changes: 1 addition & 1 deletion pandaclient/PandaToolsPkgInfo.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = "1.5.41"
release_version = "1.5.42"
13 changes: 9 additions & 4 deletions pandaclient/PathenaScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import random
import pickle
import json
import time
from pandaclient.MiscUtils import parse_secondary_datasets_opt

try:
Expand Down Expand Up @@ -1355,10 +1356,14 @@ def _onExit(dir, files, del_command):
sys.exit(EC_Archive)

# check symlinks
tmpLog.info("checking symbolic links")
status,out = commands_get_status_output('tar tvfz %s' % archiveName)
tmpLog.info("checking sandbox")
for _ in range(5):
status, out = commands_get_status_output('tar tvfz %s' % archiveName)
if status == 0:
break
time.sleep(5)
if status != 0:
tmpLog.error("Failed to expand archive")
tmpLog.error("Failed to expand sandbox. {0}".format(out))
sys.exit(EC_Archive)
symlinks = []
for line in out.split('\n'):
Expand Down Expand Up @@ -1391,7 +1396,7 @@ def _onExit(dir, files, del_command):

# put sources/jobO via HTTP POST
if not options.noSubmit:
tmpLog.info("uploading source/jobO files")
tmpLog.info("uploading sandbox")
status,out = Client.putFile(archiveName,options.verbose,useCacheSrv=True,reuseSandbox=True)
if out.startswith('NewFileName:'):
# found the same input sandbox to reuse
Expand Down
18 changes: 12 additions & 6 deletions pandaclient/PrunScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import shutil
import atexit
import argparse
import time

from pandaclient.Group_argparse import GroupArgParser
try:
from urllib import quote
Expand Down Expand Up @@ -981,7 +983,7 @@ def _onExit(dir, files, del_command):
if options.useRootCore:
# check $ROOTCOREDIR
if 'ROOTCOREDIR' not in os.environ:
tmpErrMsg = '$ROOTCOREDIR is not definied in your enviornment. '
tmpErrMsg = '$ROOTCOREDIR is not defined in your environment. '
tmpErrMsg += 'Please setup RootCore runtime beforehand'
tmpLog.error(tmpErrMsg)
sys.exit(EC_Config)
Expand Down Expand Up @@ -1204,10 +1206,14 @@ def _onExit(dir, files, del_command):

# check symlinks
if options.useAthenaPackages:
tmpLog.info("checking symbolic links")
status,out = commands_get_status_output('tar tvfz %s' % archiveName)
tmpLog.info("checking sandbox")
for _ in range(5):
status, out = commands_get_status_output('tar tvfz %s' % archiveName)
if status == 0:
break
time.sleep(5)
if status != 0:
tmpLog.error("Failed to expand archive")
tmpLog.error("Failed to expand sandbox. {0}".format(out))
sys.exit(EC_Archive)
symlinks = []
for line in out.split('\n'):
Expand Down Expand Up @@ -1241,7 +1247,7 @@ def _onExit(dir, files, del_command):
# upload source files
if not options.noSubmit:
# upload sources via HTTP POST
tmpLog.info("upload sandbox files")
tmpLog.info("upload sandbox")
if options.vo is None:
use_cache_srv = True
else:
Expand All @@ -1252,7 +1258,7 @@ def _onExit(dir, files, del_command):
archiveName = out.split(':')[-1]
elif out != 'True':
print(out)
tmpLog.error("failed to upload sandbox files with %s" % status)
tmpLog.error("failed to upload sandbox with %s" % status)
sys.exit(EC_Post)
# good run list
if options.goodRunListXML != '':
Expand Down

0 comments on commit a2b38b0

Please sign in to comment.