zephyr_mirror: Allow running multiple zephyr mirroring scripts under one user.
(imported from commit ecec50ee0e51736487358ef9f5847000d35f327a)
This commit is contained in:
parent
43ca7b3d3b
commit
9223f6b2e8
|
@ -1045,7 +1045,11 @@ or specify the --api-key-file option.""" % (options.api_key_file,))))
|
||||||
if not options.test_mode:
|
if not options.test_mode:
|
||||||
pgrep_query = "python.*zephyr_mirror"
|
pgrep_query = "python.*zephyr_mirror"
|
||||||
if options.shard is not None:
|
if options.shard is not None:
|
||||||
|
# sharded class mirror
|
||||||
pgrep_query = "%s.*--shard=%s" % (pgrep_query, options.shard)
|
pgrep_query = "%s.*--shard=%s" % (pgrep_query, options.shard)
|
||||||
|
elif options.user is not None:
|
||||||
|
# Personals mirror on behalf of another user.
|
||||||
|
pgrep_query = "%s.*--user=%s" % (pgrep_query, options.user)
|
||||||
proc = subprocess.Popen(['pgrep', '-U', os.environ["USER"], "-f", pgrep_query],
|
proc = subprocess.Popen(['pgrep', '-U', os.environ["USER"], "-f", pgrep_query],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
|
Loading…
Reference in a new issue