Skip to content

Commit

Permalink
- Only add campaign store to file name if that is not absolute path
Browse files Browse the repository at this point in the history
- list command supports second argument as path
  • Loading branch information
pnorbert committed Mar 26, 2024
1 parent 1a5cdef commit 610633f
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions source/utils/adios_campaign_manager/adios2_campaign_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def SetupArgs():
if args.campaign is not None:
if not args.campaign.endswith(".aca"):
args.CampaignFileName += ".aca"
if args.campaign_store is not None:
if (not exists(args.CampaignFileName) and
not args.CampaignFileName.startswith("/") and
args.campaign_store is not None):
args.CampaignFileName = args.campaign_store + "/" + args.CampaignFileName

args.LocalCampaignDir = "adios-campaign/"
Expand Down Expand Up @@ -444,19 +446,25 @@ def Info(args: dict, cur: sqlite3.Cursor):


def List():
if args.campaign_store is None:
print("ERROR: Set --campaign_store for this command")
return 1
path = args.campaign
if path is None:
if args.campaign_store is None:
print("ERROR: Set --campaign_store for this command")
return 1
path = args.campaign_store
else:
while path[-1] == "/":
path = path[:-1]

# List the local campaign store
acaList = glob.glob(path + "/**/*.aca", recursive=True)
if len(acaList) == 0:
print("There are no campaign archives in " + path)
return 2
else:
# List the local campaign store
acaList = glob.glob(args.campaign_store + "/**/*.aca", recursive=True)
if len(acaList) == 0:
print("There are no campaign archives in " + args.campaign_store)
return 2
else:
startCharPos = len(args.campaign_store) + 1
for f in acaList:
print(f[startCharPos:])
startCharPos = len(path) + 1
for f in acaList:
print(f[startCharPos:])
return 0


Expand Down

0 comments on commit 610633f

Please sign in to comment.