aboutsummaryrefslogtreecommitdiff
path: root/rpkid/portal-gui/scripts/rpkigui-reset-demo.py
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2012-02-17 17:53:14 +0000
committerMichael Elkins <melkins@tislabs.com>2012-02-17 17:53:14 +0000
commitf019d9705c298883207627300ffee90c7ef0764e (patch)
treee87d14e79e5abf9f1e742baf7648984bc33abd17 /rpkid/portal-gui/scripts/rpkigui-reset-demo.py
parente8dc55fd867b15c60a13e2a6b42678079465ea85 (diff)
also refresh the rescert cache
svn path=/branches/tk161/; revision=4353
Diffstat (limited to 'rpkid/portal-gui/scripts/rpkigui-reset-demo.py')
-rw-r--r--rpkid/portal-gui/scripts/rpkigui-reset-demo.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/rpkid/portal-gui/scripts/rpkigui-reset-demo.py b/rpkid/portal-gui/scripts/rpkigui-reset-demo.py
index 38b878ea..acfddabd 100644
--- a/rpkid/portal-gui/scripts/rpkigui-reset-demo.py
+++ b/rpkid/portal-gui/scripts/rpkigui-reset-demo.py
@@ -12,9 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# normally this would be a module docstring, but since this script is
-# prepending with django boilerplate, that doesn't work
-description = """
+"""
This script is used to reset all of the labuser* accounts on demo.rpki.net back
to a state suitable for a new workshop. It removes all ROAs and Ghostbuster
issued by the labuser accounts.
@@ -23,14 +21,14 @@ issued by the labuser accounts.
__version__ = '$Id$'
-from optparse import OptionParser
-from rpki.irdb.models import ROARequest, GhostbusterRequest
+from rpki.irdb.models import ROARequest, GhostbusterRequest, ResourceHolderCA
+from rpki.gui.app.glue import list_received_resources
-if __name__ == '__main__':
- parser = OptionParser(description=description)
- (options, args) = parser.parse_args()
- for n in xrange(1, 33):
- username = 'labuser%02d' % n
- print 'removing objects for ' + username
- for cls in (ROARequest, GhostbusterRequest):
- cls.objects.filter(issuer__handle=username).delete()
+for n in xrange(1, 33):
+ username = 'labuser%02d' % n
+ print 'removing objects for ' + username
+ for cls in (ROARequest, GhostbusterRequest):
+ cls.objects.filter(issuer__handle=username).delete()
+ print '... updating resource certificate cache'
+ conf = ResourceHolderCA.objects.get(handle=username)
+ list_received_resources(sys.stdout, conf)