# /afs/athena.mit.edu/contrib/scripts/deploy/APP-x.y.z for old style installs
# /afs/athena.mit.edu/contrib/scripts/wizard/srv/APP.git vx.y.z-scripts for new style installs
name = deploydir.split("/")[-1]
- if name.find(" ") != -1:
- raw_app, raw_version = name.split(" ")
- version = raw_version[1:] # remove leading v
- app, _ = raw_app.split(".") # remove trailing .git
- elif name.find("-") != -1:
- app, version = name.split("-")
- elif name == "deploy":
- # Assume that it's django, since those were botched
- app = "django"
- version = "0.1-scripts"
- else:
+ try:
+ if name.find(" ") != -1:
+ raw_app, raw_version = name.split(" ")
+ version = raw_version[1:] # remove leading v
+ app, _ = raw_app.split(".") # remove trailing .git
+ elif name.find("-") != -1:
+ app, version = name.split("-")
+ elif name == "deploy":
+ # Assume that it's django, since those were botched
+ app = "django"
+ version = "0.1-scripts"
+ else:
+ raise DeploymentParseError
+ except ValueError: # mostly from the a, b = foo.split(' ')
raise DeploymentParseError
if not applookup: applookup = applications
try: