Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create python script to rename wikis with one command (T11621) #3589

Merged
merged 19 commits into from
Mar 17, 2024

Conversation

RhinosF1
Copy link
Contributor

@RhinosF1 RhinosF1 commented Jan 7, 2024

No description provided.


args = parser.parse_args()
def get_db_cluster(oldwiki_db: str) -> str:
command = generate_salt_command('db131*', f'cmd.run "mysql -e \'SELECT wiki_dbcluster FROM mhglobal.cw_wikis WHERE wiki_dbname = "{oldwiki_db}" \' "')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be:
command = generate_salt_command('db131*', f'cmd.run 'mysql -e "SELECT wiki_dbcluster FROM mhglobal.cw_wikis WHERE wiki_dbname = '{oldwiki_db}'" '')

@Reception123
Copy link
Contributor

I've tried various things but it seems python/salt don't like escaping. We could potentially replace the SQL with a RemoteWiki getDBcluster but that would need a script.

@Reception123 Reception123 changed the title Update rename-wiki.py Create python script to rename wikis with one command (T11621) Jan 8, 2024
modules/mediawiki/files/cookbooks/rename-wiki.py Outdated Show resolved Hide resolved
modules/mediawiki/files/cookbooks/rename-wiki.py Outdated Show resolved Hide resolved
modules/mediawiki/files/cookbooks/rename-wiki.py Outdated Show resolved Hide resolved
@Universal-Omega Universal-Omega merged commit 27a7331 into miraheze:Reception123-patch-1 Mar 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants