Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fail with ConfigError without UnboundLocalError
When volumes configuration has an error in it, loop does not break
correctly. A ConfigError is returned but the  succeeding code actual
fails with an UnboundLocalError as well since volume and bind were
never initialised.

Failure before this change :
Restarting buildmaster "FRB Buildmaster"
            self.volumes.append(volume)
        exceptions.UnboundLocalError: local variable 'volume' referenced
before assignment

2016-03-15 21:27:27+0000 [-] Configuration Errors:
2016-03-15 21:27:27+0000 [-]   Invalid volume definition for docker
/tmp/t/tmp/t. Skipping...
2016-03-15 21:27:27+0000 [-]   error while parsing config file: local
variable 'volume' referenced before assignment (traceback in logfile)
2016-03-15 21:27:27+0000 [-] Halting master.

Failure after this change :
Restarting buildmaster "FRB Buildmaster"
2016-03-15 21:27:19+0000 [-]
2016-03-15 21:27:19+0000 [-] Configuration Errors:
2016-03-15 21:27:19+0000 [-]   Invalid volume definition for docker
/tmp/t/tmp/t. Skipping...
2016-03-15 21:27:19+0000 [-] Halting master.
  • Loading branch information
anish committed Mar 16, 2016
1 parent 605ed7b commit 0c877e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions master/buildbot/worker/docker.py
Expand Up @@ -79,6 +79,7 @@ def __init__(self, name, password, docker_host, image=None, command=None,
except ValueError:
config.error("Invalid volume definition for docker "
"%s. Skipping..." % volume_string)
continue
self.volumes.append(volume)

ro = False
Expand Down

0 comments on commit 0c877e3

Please sign in to comment.