mirror of
https://github.com/ceph/ceph
synced 2025-03-20 09:16:59 +00:00
Merge pull request #38011 from mgfritch/cephadm-sudo-log-dir
cephadm: verify root privileges before log dir create Reviewed-by: Dimitri Savineau <dsavinea@redhat.com> Reviewed-by: Juan Miguel Olmo <jolmomar@redhat.com>
This commit is contained in:
commit
d2df27ef63
@ -6059,6 +6059,11 @@ def _parse_args(av):
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# root?
|
||||
if os.geteuid() != 0:
|
||||
sys.stderr.write('ERROR: cephadm should be run as root\n')
|
||||
sys.exit(1)
|
||||
|
||||
# Logger configuration
|
||||
if not os.path.exists(LOG_DIR):
|
||||
os.makedirs(LOG_DIR)
|
||||
@ -6079,11 +6084,6 @@ if __name__ == "__main__":
|
||||
if handler.name == "console":
|
||||
handler.setLevel(logging.DEBUG)
|
||||
|
||||
# root?
|
||||
if os.geteuid() != 0:
|
||||
sys.stderr.write('ERROR: cephadm should be run as root\n')
|
||||
sys.exit(1)
|
||||
|
||||
if 'func' not in args:
|
||||
sys.stderr.write('No command specified; pass -h or --help for usage\n')
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user