Root check removed
This commit is contained in:
parent
61435791fc
commit
39df2adef5
@ -100,9 +100,9 @@ _Внимание_! Только Python 2.7, только PostgreSQL, тольк
|
||||
|
||||
```
|
||||
sudo mkdir -p /var/www/py-phias
|
||||
sudo chown www-fias: /var/www/py-phias
|
||||
sudo chown phias: /var/www/py-phias
|
||||
wget https://github.com/jar3b/py-phias/archive/v0.0.1.tar.gz
|
||||
sudo -u www-fias tar xzf v0.0.1.tar.gz -C /var/www/py-phias --strip-components=1
|
||||
sudo -u phias tar xzf v0.0.1.tar.gz -C /var/www/py-phias --strip-components=1
|
||||
cd /var/www/py-phias
|
||||
sudo pip install -r requirements.txt
|
||||
```
|
||||
|
19
manage.py
19
manage.py
@ -1,10 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import ctypes
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
from aore.miscutils.sphinx import SphinxHelper
|
||||
from aore.updater.soapreceiver import SoapReceiver
|
||||
@ -13,15 +10,6 @@ from aore.updater.updater import Updater
|
||||
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
|
||||
|
||||
|
||||
def is_root():
|
||||
try:
|
||||
is_admin = os.getuid() == 0
|
||||
except AttributeError:
|
||||
is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
|
||||
|
||||
return is_admin
|
||||
|
||||
|
||||
def print_fias_versions():
|
||||
imp = SoapReceiver()
|
||||
current_version = Updater.get_current_fias_version()
|
||||
@ -116,10 +104,6 @@ def main():
|
||||
|
||||
# Manage DB
|
||||
if options.database:
|
||||
if 'Linux' in platform.system() and not is_root():
|
||||
print "This option need to be run with elevated privileges."
|
||||
return
|
||||
|
||||
# create new database
|
||||
aoupdater = Updater(options.source)
|
||||
allowed_updates = None
|
||||
@ -135,9 +119,6 @@ def main():
|
||||
|
||||
# Manage Sphinx
|
||||
if options.sphinx and options.indexer_path and options.output_conf:
|
||||
if 'Linux' in platform.system() and not is_root():
|
||||
print "This option need to be run with elevated privileges."
|
||||
return
|
||||
sphinxh = SphinxHelper()
|
||||
sphinxh.configure_indexer(options.indexer_path, options.output_conf)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user