Commit b6cc7ac0 authored by Nicolas Wavrant's avatar Nicolas Wavrant

free_port: fixup

parent 579cf79d
......@@ -48,16 +48,14 @@ class Recipe(GenericBaseRecipe):
# requested service itself.
# If this check isn't done, a new port would be picked for every upgrade
# of the software release
try:
port = self.getValueFromPreviousRun(name, 'port')
# Port can be 0 in case of upgrade: some old service still runs on port,
# so 0 is returned by default. Then, on next run, this recipe is processed
# again until a correct value is returned
if port != '0':
self.options['port'] = port
return
except (IOError, ConfigParser.NoSectionError, ConfigParser.NoOptionError):
pass
port = self.getValueFromPreviousRun(name, 'port')
# Port can be 0 in case of upgrade: some old service still runs on port,
# so 0 is returned by default. Then, on next run, this recipe is processed
# again until a correct value is returned
if port != '0':
self.options['port'] = port
return
# Otherwise, let's find one
self.minimum = int(options.get('minimum', 1024))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment