Chad has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/372564 )
Change subject: Scap clean: ensure proper ordering of commands
......................................................................
Scap clean: ensure proper ordering of commands
Change-Id: Ia64811ea349f3cf03c962029fb70e6c7cb3e7d5e
---
M scap/plugins/clean.py
1 file changed, 35 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/64/372564/1
diff --git a/scap/plugins/clean.py b/scap/plugins/clean.py
index 286423b..5c91251 100644
--- a/scap/plugins/clean.py
+++ b/scap/plugins/clean.py
@@ -83,18 +83,24 @@
if not os.path.isdir(stage_dir):
raise ValueError('No such branch exists, aborting')
- commands = {
- 'clean-l10nupdate-cache':
- ['sudo', '-u', 'www-data', 'rm', '-fR',
- '/var/lib/l10nupdate/caches/cache-%s' % branch],
- 'clean-l10nupdate-owned-files':
- ['sudo', '-u', 'l10nupdate', 'find', stage_dir,
- '-user', 'l10nupdate', '-delete'],
- 'clean-l10n-bootstrap':
- ['rm', '-fR', os.path.join(
- self.config['stage_dir'], 'wmf-config',
- 'ExtensionMessages-%s.php' % branch)],
- }
+ command_list = []
+
+ command_list.append([
+ 'clean-l10nupdate-cache',
+ ['sudo', '-u', 'www-data', 'rm', '-fR',
+ '/var/lib/l10nupdate/caches/cache-%s' % branch]
+ ])
+ command_list.append([
+ 'clean-l10nupdate-owned-files',
+ ['sudo', '-u', 'l10nupdate', 'find', stage_dir,
+ '-user', 'l10nupdate', '-delete']
+ ])
+ command_list.append([
+ 'clean-l10n-bootstrap',
+ ['rm', '-fR', os.path.join(
+ self.config['stage_dir'], 'wmf-config',
+ 'ExtensionMessages-%s.php' % branch)]
+ ])
logger = self.get_logger()
@@ -115,16 +121,26 @@
with utils.cd(stage_dir):
if subprocess.call(gerrit_prune_cmd) != 0:
logger.info('Failed to prune core branch')
- commands['cleaning-branch'] = ['rm', '-fR', stage_dir]
- commands['cleaning-patches'] = [
- 'rm' '-fR', os.path.join('/srv/patches', branch)]
+ command_list.append([
+ 'cleaning-branch',
+ ['rm', '-fR', stage_dir]
+ ])
+ command_list.append([
+ 'cleaning-patches',
+ ['rm' '-fR', os.path.join('/srv/patches', branch)]
+ ])
else:
regex = r'".*\.?({0})$"'.format('|'.join(DELETABLE_TYPES))
- commands['cleaning-branch'] = ['find', stage_dir, '-type', 'f',
- '-regextype', 'posix-extended',
- '-regex', regex, '-delete']
+ command_list.append([
+ 'cleaning-branch',
+ ['find', stage_dir, '-type', 'f',
+ '-regextype', 'posix-extended',
+ '-regex', regex, '-delete']
+ ])
- for name, command in commands.iteritems():
+ for command_set in command_list:
+ name = command_set[0]
+ command = command_set[0]
with log.Timer(name + '-' + branch, self.get_stats()):
try:
subprocess.call(command)
--
To view, visit https://gerrit.wikimedia.org/r/372564
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia64811ea349f3cf03c962029fb70e6c7cb3e7d5e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits