Skip to content

Commit

Permalink
Fix indentation in fix_container_permissions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paladox authored Feb 9, 2024
1 parent 955174b commit 603d01c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions miraheze/swift/fix_container_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import sys

if len(sys.argv) != 2:
print("Please use in form of 'python fix_containers.py foowiki'")
sys.exit(1)
print("Please use in form of 'python fix_containers.py foowiki'")
sys.exit(1)

wiki = sys.argv[1]

out = subprocess.run(['sudo', '-u', 'www-data', 'php', '/srv/mediawiki/1.41/maintenance/run.php', '/srv/mediawiki/1.41/extensions/CreateWiki/maintenance/setContainersAccess.php', '--wiki', wiki], capture_output=True, text=True)

matches = re.findall(r"Making sure 'mwstore:\/\/miraheze-swift\/([^']+)' [^\n]+\.failed\.", out.stdout)
for match in matches:
os.system(f"swift post --read-acl 'mw:media' --write-acl 'mw:media' miraheze-{wiki}-{match}")
os.system(f"swift post --read-acl 'mw:media' --write-acl 'mw:media' miraheze-{wiki}-{match}")

os.system(f"sudo -u www-data php /srv/mediawiki/1.41/maintenance/run.php /srv/mediawiki/1.41/extensions/CreateWiki/maintenance/setContainersAccess.php --wiki {wiki}")
os.system(f'sudo -u www-data php /srv/mediawiki/1.41/maintenance/run.php /srv/mediawiki/1.41/extensions/CreateWiki/maintenance/setContainersAccess.php --wiki {wiki}')

0 comments on commit 603d01c

Please sign in to comment.