Page MenuHomePhabricator

Scap scripts on mw1017 are incorrect
Closed, ResolvedPublic

Description

On mw1017, the scap bin scripts are different than the packaged scripts. The scripts on tin.eqiad.wmnet are correct.

thcipriani@tin:~
❯ cat $(which sync-common)
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Sync MW_COMMON
#
# Copyright © 2016 Wikimedia Foundation and contributors

import os
import sys

# Add scap package to search path
script = os.path.realpath(sys.argv[0])
scap_src = os.path.dirname(os.path.dirname(script))
sys.path.append(scap_src)

import scap

out = scap.utils.deprecated_script('Try `scap pull`')
sys.stderr.write(out)

scap.cli.Application.run(script=scap.SyncCommon)
thcipriani@mw1017:~$ cat $(which sync-common)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Sync MW_COMMON
#
# Copyright © 2014 Wikimedia Foundation and contributors

import os
import sys

# Add scap package to search path
script = os.path.realpath(sys.argv[0])
scap_src = os.path.dirname(os.path.dirname(script))
sys.path.append(scap_src)

import scap
scap.SyncCommon.run()

Event Timeline

blerg. Because there are old binstubs in the system path that are shadowing the package installed ones!

These don't seem to exist in Puppet anywhere, they may just be old cruft, either way we should get these cleared out ASAP.

thcipriani@mw1017:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/srv/deployment/scap/scap/bin
thcipriani@mw1017:~$ which sync-common
/usr/local/bin/sync-common
thcipriani@mw1017:~$ file /usr/bin/sync-common
/usr/bin/sync-common: Python script, UTF-8 Unicode text executable
thcipriani@mw1017:~$ cat /usr/bin/sync-common
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Sync MW_COMMON
#
# Copyright © 2016 Wikimedia Foundation and contributors

import os
import sys

# Add scap package to search path
script = os.path.realpath(sys.argv[0])
scap_src = os.path.dirname(os.path.dirname(script))
sys.path.append(scap_src)

import scap

out = scap.utils.deprecated_script('Try `scap pull`')
sys.stderr.write(out)

scap.cli.Application.run(script=scap.SyncCommon)

Change 288630 had a related patch set uploaded (by Thcipriani):
Clean old scap code

https://gerrit.wikimedia.org/r/288630

thcipriani claimed this task.