Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
Bug 821624, support for specifying promptWaitTime for updates, r=bhea…
Browse files Browse the repository at this point in the history
…rsum
  • Loading branch information
nthomas-mozilla committed Dec 20, 2012
1 parent 4ec5faf commit d16c342
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions lib/python/release/updates/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from apache_conf_parser import ApacheConfParser

from release.platforms import ftp2bouncer
from release.updates.snippets import SCHEMA_2_OPTIONAL_ATTRIBUTES
from release.updates.snippets import (SCHEMA_2_OPTIONAL_ATTRIBUTES,
SCHEMA_2_OPTIONAL_ATTRIBUTES_SINGLE_VALUE,
SCHEMA_2_OPTIONAL_ATTRIBUTES_MULTI_VALUE)

log = logging.getLogger()

Expand Down Expand Up @@ -222,10 +224,12 @@ def parseCurrentUpdate(self, currentUpdate):
raise PatcherConfigError("Found multiple entries for '%s' in current-update section" % node.name)

# These are all single-value nodes.
if node.name in ('details', 'from', 'to', 'beta-dir'):
if node.name in ('details', 'from', 'to', 'beta-dir') + \
SCHEMA_2_OPTIONAL_ATTRIBUTES_SINGLE_VALUE:
cu[node.name] = self._stripStringNode(node.content)
# These are potentially multiple value nodes.
elif node.name in ('channel', 'testchannel', 'actions'):
elif node.name in ('channel', 'testchannel') + \
SCHEMA_2_OPTIONAL_ATTRIBUTES_MULTI_VALUE:
cu[node.name] = list(node.arguments)
# Force is weird in that it's a multiple value node, but the
# patcher config bumping script lists it multiple times rather
Expand Down
9 changes: 6 additions & 3 deletions lib/python/release/updates/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

from release.platforms import ftp2updatePlatforms, ftp_update_platform_map

SCHEMA_2_OPTIONAL_ATTRIBUTES = (
'showPrompt', 'showNeverForVersion', 'showSurvey', 'actions', 'licenseUrl',
'billboardURL', 'openURL', 'notificationURL', 'alertURL',
SCHEMA_2_OPTIONAL_ATTRIBUTES_SINGLE_VALUE = (
'showPrompt', 'showNeverForVersion', 'showSurvey', 'licenseUrl',
'billboardURL', 'openURL', 'notificationURL', 'alertURL', 'promptWaitTime',
)
SCHEMA_2_OPTIONAL_ATTRIBUTES_MULTI_VALUE = ('actions',)
SCHEMA_2_OPTIONAL_ATTRIBUTES = SCHEMA_2_OPTIONAL_ATTRIBUTES_SINGLE_VALUE + \
SCHEMA_2_OPTIONAL_ATTRIBUTES_MULTI_VALUE

schema1_snippet_template = """\
version=%(schema)s
Expand Down

0 comments on commit d16c342

Please sign in to comment.