mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
scripts: Make upgrade-zulip-* use root checking from zulip_tools.
This is mostly just a nice code deduplication/cleanup.
This commit is contained in:
committed by
Tim Abbott
parent
cfe603f342
commit
eae9251cb7
@@ -24,16 +24,14 @@ os.environ["PYTHONUNBUFFERED"] = "y"
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, FAIL, WARNING, ENDC, make_deploy_path, \
|
||||
get_deployment_lock, release_deployment_lock, su_to_zulip
|
||||
get_deployment_lock, release_deployment_lock, su_to_zulip, script_should_be_root
|
||||
|
||||
script_should_be_root(strip_lib_from_paths=True)
|
||||
|
||||
logging.Formatter.converter = time.gmtime
|
||||
logging.basicConfig(format="%(asctime)s upgrade-zulip-from-git: %(message)s",
|
||||
level=logging.INFO)
|
||||
|
||||
if os.getuid() != 0:
|
||||
logging.error("Must be run as root.")
|
||||
sys.exit(1)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("refname", help="Git reference, e.g. a branch, tag, or commit ID.")
|
||||
parser.add_argument("--remote-url", dest="remote_url",
|
||||
|
||||
Reference in New Issue
Block a user