Skip to content

Commit

Permalink
bugs in rmapctrl
Browse files Browse the repository at this point in the history
  • Loading branch information
pat1 committed Oct 6, 2023
1 parent 1b00f7c commit 69a8005
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/rmapctrl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import sys, optparse, rmap.daemon
from rmap import __version__
from django.contrib.auth.hashers import make_password
from rmap.utils import nint
import json

def ctrl(cwd):
p = optparse.OptionParser(usage="usage: %prog [options]",version="%prog "+__version__)
Expand All @@ -44,7 +45,7 @@ def ctrl(cwd):
p.add_option('--username', default=None, help="work on station managed by this username")
p.add_option('--station_slug', default=None, help="work on station defined by this slug")
p.add_option('--purge_rpc',action="store_true", help="remove non active RPC (submitted, running and completed")
p.add_option('--purge_rpc:completed',action="store_true", help="remove non active RPC and completed")
p.add_option('--purge_rpc_completed',action="store_true", help="remove non active RPC and completed")

(options, args) = p.parse_args()

Expand Down Expand Up @@ -218,7 +219,7 @@ def ctrl(cwd):
for mystationmetadata in stationmetadatas:
if mystationmetadata.active:
method="admin"
params="{"fdownload":true}"
params=json.loads('{"fdownload": true}')
myrpc=Rpc(stationmetadata=mystationmetadata,method=method,params=params)
print (u.username,mystationmetadata.slug,"execute:",myrpc)
myrpc.save()
Expand All @@ -227,7 +228,7 @@ def ctrl(cwd):
if (options.purge_rpc):
Rpc.objects.filter(active=False).delete()
if (options.purge_rpc_completed):
Rpc.objects.filter(active=False,status="completed").delete()
Rpc.objects.filter(active=False).exclude(dateres=None).delete()


if __name__ == '__main__':
Expand Down

0 comments on commit 69a8005

Please sign in to comment.