update rtcron.sh to run python scripts
remove callplcsh.py
try:
# if this file deos not exist, then we will jump to the exception and use
# the local PLCSH without passing any additional arguments.
try:
# if this file deos not exist, then we will jump to the exception and use
# the local PLCSH without passing any additional arguments.
os.stat("/etc/planetlab/master.py")
sys.path.append("/etc/planetlab")
import master
os.stat("/etc/planetlab/master.py")
sys.path.append("/etc/planetlab")
import master
# Use the values given to us in the /etc/planetlab/master.py file taken from
# the master PLC and use them to construct the proper arguments to plcsh so
# that we can get a user list from managing, CoPLC
# Use the values given to us in the /etc/planetlab/master.py file taken from
# the master PLC and use them to construct the proper arguments to plcsh so
# that we can get a user list from managing, CoPLC
user=master.PLC_ROOT_USER
passwd=master.PLC_ROOT_PASSWORD
url = "https://" + master.PLC_API_HOST + ":" \
+ master.PLC_API_PORT + master.PLC_API_PATH
user=master.PLC_ROOT_USER
passwd=master.PLC_ROOT_PASSWORD
url = "https://" + master.PLC_API_HOST + ":" \
+ master.PLC_API_PORT + master.PLC_API_PATH
- cmd = "plcsh --user=%s --password=%s --url=%s %s" % (user,
- passwd, url, " ".join(sys.argv[1:]))
+ plcsh_args = "--user=%s --password=%s --url=%s %s" % (user, passwd, url, " ".join(sys.argv[1:]))
- cmd = "plcsh %s" % " ".join(sys.argv[1:])
+ plcsh_args = "%s" % " ".join(sys.argv[1:])
+dir = "/usr/share/plcrt"
+os.system("chmod 755 %s/getpersons.py" % dir)
+os.system("%s/getpersons.py %s -- admin | %s/adduserstort.pl priv -" % ( dir, plcsh_args, dir) )
+++ /dev/null
-#!/bin/bash
-
-RTDIR=/usr/share/plcrt
-${RTDIR}/callplcsh.py ${RTDIR}/getpersons.py admin | ${RTDIR}/adduserstort.pl priv -
#!/bin/bash
D=/usr/share/plcrt/
#!/bin/bash
D=/usr/share/plcrt/
-for f in $D/cron.d/*.sh ; do
- bash -c "$f"
+for f in $D/cron.d/*.py ; do
+ $f