Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Ignore node not found error
Browse files Browse the repository at this point in the history
This ignores errors if the machine can't be found in the database.
This is to ease the transition to nodepool.

Change-Id: I3f3a1b8804e48f5a8643971f003246aca413a866
  • Loading branch information
James E. Blair committed Aug 15, 2013
1 parent 12571b2 commit 339b3da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion devstack-vm-delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@
def main():
db = vmdatabase.VMDatabase()

machine = db.getMachineByJenkinsName(NODE_NAME)
try:
machine = db.getMachineByJenkinsName(NODE_NAME)
except Exception:
utils.log.debug("Unable to find node: %s" % NODE_NAME)
return

if machine.state != vmdatabase.HOLD:
utils.log.debug("Set deleted ID: %s old state: %s build: %s" % (
machine.id, machine.state, BUILD_URL))
Expand Down
7 changes: 6 additions & 1 deletion devstack-vm-inprogress.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ def main():
else:
jenkins = None

machine = db.getMachineByJenkinsName(NODE_NAME)
try:
machine = db.getMachineByJenkinsName(NODE_NAME)
except Exception:
utils.log.debug("Unable to find node: %s" % NODE_NAME)
return

utils.log.debug("Used ID: %s old state: %s build:%s" % (
machine.id, machine.state, BUILD_URL))

Expand Down

0 comments on commit 339b3da

Please sign in to comment.