CC-2567: Install api_client separately from pypo
This commit is contained in:
parent
28b71c61d6
commit
ff2fcde7c0
13 changed files with 44 additions and 8 deletions
1
python_apps/api_clients/api_client.cfg
Normal file
1
python_apps/api_clients/api_client.cfg
Normal file
|
@ -0,0 +1 @@
|
|||
bin_dir = "/usr/lib/airtime/api_clients"
|
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
|
||||
def get_current_script_dir():
|
||||
return os.path.dirname(os.path.realpath(__file__))
|
||||
|
@ -15,9 +17,9 @@ current_script_dir = get_current_script_dir()
|
|||
|
||||
"""load config file"""
|
||||
try:
|
||||
config = ConfigObj("current_script_dir/../config.cfg")
|
||||
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
copy_dir("%s/../../api_clients"%current_script_dir, config["bin_dir"]+"/api_clients/")
|
||||
copy_dir("%s/../../api_clients"%current_script_dir, config["bin_dir"])
|
||||
|
|
21
python_apps/api_clients/install/api_client_uninstall.py
Normal file
21
python_apps/api_clients/install/api_client_uninstall.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
import os
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
|
||||
def remove_path(path):
|
||||
os.system('rm -rf "%s"' % path)
|
||||
|
||||
def get_current_script_dir():
|
||||
return os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
"""load config file"""
|
||||
try:
|
||||
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
print "Removing API Client files"
|
||||
remove_path(config["bin_dir"])
|
|
@ -1 +0,0 @@
|
|||
bin_dir = "/usr/lib/airtime/api_clients/bin"
|
|
@ -4,7 +4,7 @@
|
|||
media_monitor_path="/usr/lib/airtime/media-monitor/"
|
||||
media_monitor_script="MediaMonitor.py"
|
||||
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
cd ${media_monitor_path}
|
||||
|
||||
exec 2>&1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
ls_user="pypo"
|
||||
export HOME="/var/tmp/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
ls_path="/usr/lib/airtime/pypo/bin/liquidsoap_bin/liquidsoap"
|
||||
ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ pypo_user="pypo"
|
|||
|
||||
# Location of pypo_cli.py Python script
|
||||
pypo_path="/usr/lib/airtime/pypo/bin/"
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
pypo_script="pypo-cli.py"
|
||||
cd ${pypo_path}
|
||||
exec 2>&1
|
||||
|
|
|
@ -96,7 +96,6 @@ try:
|
|||
sys.exit(1)
|
||||
|
||||
copy_dir("%s/.."%current_script_dir, config["bin_dir"]+"/bin/")
|
||||
copy_dir("%s/../../api_clients"%current_script_dir, config["bin_dir"]+"/api_clients/")
|
||||
|
||||
print "Setting permissions"
|
||||
os.system("chmod -R 755 "+config["bin_dir"])
|
||||
|
|
|
@ -7,7 +7,7 @@ recorder_user="pypo"
|
|||
recorder_path="/usr/lib/airtime/show-recorder/"
|
||||
recorder_script="recorder.py"
|
||||
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
cd ${recorder_path}
|
||||
|
||||
exec 2>&1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue