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

update rename wiki script with "good version" #3814

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Reception123
Copy link
Contributor

No description provided.

Copy link
Sponsor Member

@Universal-Omega Universal-Omega left a comment

Choose a reason for hiding this comment

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

There is no c5 anymore since migration and we should not use /home/reception in puppetized script should use the current users puppet

@RhinosF1
Copy link
Contributor

RhinosF1 commented Apr 2, 2024

There is no c5 anymore since migration and we should not use /home/reception in puppetized script should use the current users puppet

#3817

- removed c5
- improved logging
- stopped hardcoding reception's homedir
- catch an error

---------

Co-authored-by: Reception123 <utilizator.receptie123@gmail.com>
@@ -9,6 +12,7 @@ class DbClusterMap(TypedDict):
c2: str
c3: str
c4: str
c5: str
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Still no c5 CC @RhinosF1

@@ -21,10 +25,10 @@ class DbClusterMap(TypedDict):


def generate_salt_command(cluster: str, command: str) -> str:
return f'salt-ssh -E "{cluster}*" cmd.run "{command}"'
return f'salt-ssh -E "{cluster}" cmd.run "{command}"'
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

IIRC we don't need -E if we aren't using * but isn't * required if the full hostname is IE db151.wikitide.net? I can't remember if salt uses that or just db151 though


# Step 3: Execute MediaWiki rename script
execute_salt_command(salt_command=generate_salt_command('mwtask181', f'sudo -u www-data php /srv/mediawiki/1.41/extensions/CreateWiki/maintenance/renameWiki.php --wiki=loginwiki --rename {oldwiki_db} {newwiki_db} $user'))
execute_salt_command(salt_command=generate_salt_command('mwtask181', f'mwscript extensions/CreateWiki/renameWiki.php loginwiki --no-log --rename {oldwiki_db} {newwiki_db} {os.getlogin()}'))
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I think mwtask181 should be some sort of constant so it is easy to change if task server is changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that makes sense, how exactly would I do that here?

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Similar to

DEPLOYUSER = 'www-data'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants